This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

WordPress Development

My recent threads

You haven't posted any discussions yet.

Recently updated threads

Walkthrough for Week 2 Assignment

Go back to: General discussion

Here is the link for the walkthrough:

http://bit.ly/i2VVNa

As you can see there was some confusion (totally my fault!) about this assignment. Everyone ended up using a poll plugin when in fact the goal was to get people into the creation of a basic widget. If you're interested in that I hope the walkthrough is enough to get you started now :)

Aashvi Vyas's picture
Aashvi Vyas
Tue, 2011-02-15 21:28

Nuno,
Thanks for detailed explanation for widget creation concept.
i also gone through following references
(1) http://www.reynoldsftw.com/2009/01/wordpress-widget-beginners-guide/

(2) http://www.lonewolfdesigns.co.uk/create-wordpress-widgets/

(3) http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creat...

all above reference us
"add_action" function with different 1st argument...like

add_action("plugins_loaded", "myHelloWorld_init");
or
add_action('widgets_init', array($this, 'init_myWidget'));

your walkthrough not use this function.
Nuno! please provide us
- In which case we need to use add_action function?
- What happen if we pass 1st argument as "plugins_loaded" or "widget_loaded"?

thanks

Matej Rokos's picture
Matej Rokos
Tue, 2011-02-15 23:15

These two hooks (plugins_loaded and widgets_init) are different as Plugins and Widgets are different. Historically, plugins were in Wordpress before Widgets. A plugin does not have to be a widget, but widget is always a plugin.
Read about it on http://notagrouch.com/technophile/wordpress/wordpress-plugins-widgets-di...

For creating widgets you may also use WP_Widget class wchich was introduced in Wordpress 2.8. I use WP_Widget in my submission.
Take look and download the source code: http://p2pu.marblenews.net/