E-Mail 'New WP_Widget Class In WordPress 2.8' To A Friend
Email a copy of 'New WP_Widget Class In WordPress 2.8' to a friend
Loading ...
(172 votes, average: 4.01 out of 5)
25 thoughts on “New WP_Widget Class In WordPress 2.8”
Lester, can you explain what the new WP_widget class means to us non-developers?
What can the end user expect to see when this class gets implemented?
For non-developers using WP, you can except multi-instances of all widgets even those plugin that has widgets provided that the plugin author has updated the code.
Taking WP-Polls as an example, you can have 10 Polls Widget now instead of the usual 1.
Hi
Thanks for your guide. I have followed your guide and managed to create multiple instances of the plug-in and had then displayed them on different sidebars.
But when I try to change the options on one widget on a sidebar … the changes will automatically apply to all the instances of widgets on all other sidebars!?
Do you have an idea on how to allow the plug-in handle multiple instances of widgets? Or …
Anyway, I have learnt a lot for the first time about Widget once read this guide. Thanks again
Leon
I’ve zipped the file and uploaded it using the 2.8.1 plugin page on my site. It says it uploaded successfully but I’m getting the error ‘plugin does not have a valid header’ when I try to activate it. Do you know what this is?
Erm this is not a full plugin code, it is just a snippet
Lester — thank you!! I have been all over the Internet and tried many tutorials for adding a WP2.8 widget to my plugin and nothing worked until I found your post. Thank you for sharing your code. It has helped me tremendously!
No problem Jodi! Glad it has help you =)
Lester, thanks! This was just what I was looking for.
LC, I am impressed. Speechless for this tutorial, I’ve been able to convert to this method and it saves time and code and gives us developers and blog users great flexibility. Thanks! Searched the whole Google but didnt find something close to this tutorial. Its straightforward and simple.
Lester, can you explain what the new WP_widget class means to us non-developers?
What can the end user expect to see when this class gets implemented?
For non-developers using WP, you can except multi-instances of all widgets even those plugin that has widgets provided that the plugin author has updated the code.
Taking WP-Polls as an example, you can have 10 Polls Widget now instead of the usual 1.
Thanks for the really helpful info. That’s a 5 stars for sure.
Just saw this update on Twitter and seems like wordpress is keeping up its promise by giving the best of feature with every new release.
Thank you. This worked perfectly. =]
Hi
Thanks for your guide. I have followed your guide and managed to create multiple instances of the plug-in and had then displayed them on different sidebars.
But when I try to change the options on one widget on a sidebar … the changes will automatically apply to all the instances of widgets on all other sidebars!?
Do you have an idea on how to allow the plug-in handle multiple instances of widgets? Or …
Anyway, I have learnt a lot for the first time about Widget once read this guide. Thanks again
Leon
Could you try on my wp-polls2.50 on WP2.8 Beta/RC1, http://downloads.wordpress.org/plugin/wp-polls.zip and see if the same happens as well?
You should change `$title = attr($instance[‘title’]);` into `$title = esc_attr($instance[‘title’]);` on line 13.
This issue could confuse some plugin developer.
Thanks updated. This post is posted before the esc_* function takes place.
Lester,
I’ve zipped the file and uploaded it using the 2.8.1 plugin page on my site. It says it uploaded successfully but I’m getting the error ‘plugin does not have a valid header’ when I try to activate it. Do you know what this is?
Erm this is not a full plugin code, it is just a snippet
Lester — thank you!! I have been all over the Internet and tried many tutorials for adding a WP2.8 widget to my plugin and nothing worked until I found your post. Thank you for sharing your code. It has helped me tremendously!
No problem Jodi! Glad it has help you =)
Lester, thanks! This was just what I was looking for.
LC, I am impressed. Speechless for this tutorial, I’ve been able to convert to this method and it saves time and code and gives us developers and blog users great flexibility. Thanks! Searched the whole Google but didnt find something close to this tutorial. Its straightforward and simple.
Thanks for the kind compliments =)