Book Image

WordPress 3 Plugin Development Essentials

Book Image

WordPress 3 Plugin Development Essentials

Overview of this book

WordPress is one of the most popular platforms for building blogs and general websites. By learning how to develop and integrate your own plugins, you can add functionality and extend WordPress in any way imaginable. By tapping into the additional power and functionality that plugins provide, you can make your site easier to administer, add new features, or even alter the very nature of how WordPress works. Covering WordPress version 3, this book makes it super easy for you to build a variety of plugins.WordPress 3 Plugin Development Essentials is a practical hands-on tutorial for learning how to create your own plugins for WordPress. Using best coding practices, this book will walk you through the design and creation of a variety of original plugins.WordPress 3 Plugin Development Essentials focuses on teaching you all aspects of modern WordPress development. The book uses real and published WordPress plugins and follows their creation from the idea to the finishing touches in a series of easy-to-follow and informative steps. You will discover how to deconstruct an existing plugin, use the WordPress API in typical scenarios, hook into the database, version your code with SVN, and deploy your new plugin to the world.Each new chapter introduces different features of WordPress and how to put them to good use, allowing you to gradually advance your knowledge. WordPress 3 Plugin Development Essentials is packed with information, tips, and examples that will help you gain comfort and confidence in your ability to harness and extend the power of WordPress via plugins.
Table of Contents (19 chapters)
WordPress 3 Plugin Development Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Actions


See the WordPress Codex "Action" reference (http://goo.gl/zo5vY) for a more complete list.

admin_init

Runs at the beginning of every admin page before the page is rendered. If you need to display data to the admin users, this is a great action to hook into.

admin_menu

Runs after the basic admin panel menu structure is in place. Hook into this action when adding your own custom menu items.

Example:

add_action('admin_menu', 'ContentRotator::add_menu_item');

do_meta_boxes

Runs as meta boxes are being constructed in the manager. Meta boxes are any "extra" bit of data displayed, for example, custom fields on a post edit page.

Example:

add_action( 'do_meta_boxes', 'StandardizedCustomContent::remove_default_custom_fields', 10, 3 );

init

Runs after WordPress has finished loading but before any headers are sent.

Example:

add_action('init', 'LiveSearch::initialize');

save_post

This action is called immediately after a post or page is created or updated.

Example:

add_action('save_post', 'StandardizedCustomContent::save_custom_fields', 1, 2 );

widgets_init

Runs in the Dashboard when widgets are registered.

Example:

add_action('widgets_init', 'ContentRotatorWidget::register_this_widget');

wp_head

Runs when the template calls the wp_head function.

Example:

add_action('wp_head','diggthis_add_js_to_doc_head');