Extending WP PART 2 Extending WordPress
Extending WP CORE
Extending WP core = essential WordPress files
Extending WP DON’T
Extending WP HACK
Extending WP CORE
Extending WP Don’t Hack Core WHY? Can’t Upgrade :(
Extending WP Don’t Hack Core
Extending WP PLUGINS
Extending WP Plugins “Plugins are tools to extend the functionality of WordPress. The core of WordPress is designed to be lean, to maximize flexibility and minimize code bloat. Plugins offer custom functions and features so that each user can tailor their site to their specific needs.”
Extending WP Hello World
Extending WP Hello World
Extending WP Hello World
Extending WP Hello World
Extending WP Hello World
Extending WP PROGRAMMING YOUR PLUGIN
Extending WP HOOKS
Extending WP TWO Actions TYPES Filters
Extending WP modify the default behavior of WP
Extending WP Actions “Actions are the hooks that the WordPress core launches at specific points during execution, or when specific events occur. Your plugin can specify that one or more of its PHP functions are executed at these points, using the Action API.”
Extending WP Actions hook_name = name of action hook your_function_name = name of function you have defined to be executed following the specified action hook priority (optional) = an integer that can be used to specify the order of action hooks. (default: 10) accepted_args (optional) = how many arguments your function takes
Extending WP Actions
Extending WP Actions
Extending WP Actions http://codex.wordpress.org/Plugin_API/Action_Reference plugins_loaded, wp_head, wp_print_styles, wp_print_scripts, wp_footer, wp_print_footer_scripts, add_attachment, add_category, delete_category, delete_post, edit_attachment, edit_category, edit_post, publish_page, publish_post, save_post, comment_post, edit_comment, delete_comment
Filters Extending WP “Filters are the hooks that WordPress launches to modify text of various types before adding it to the database or sending it to the browser screen. Your plugin can specify that one or more of its PHP functions is executed to modify specific types of text at these times, using the Filter API.”
Extending WP Filters tag = name of filter hook your_function_name = name of function you have defined to be apply filter priority (optional) = an integer that can be used to specify the order of filter hooks. (default: 10) accepted_args (optional) = how many arguments your function takes
Filters Extending WP
Extending WP Filters http://codex.wordpress.org/Plugin_API/Filter_Reference wp_title, the_title, the_excerpt, the_content, the_author, login_headertitle, login_headerurl, login_message, comment_excerpt, widget_title, excerpt_length, excerpt_more
Extending WP From WP.org... Follow Coding Standards. Use Unique Names. Don’t hardcode DB prefixes but use $wpdb->prefix instead. (ie. wp_) SELECT only what you need. Add define('WP_DEBUG', true); to your wp-config.php file.
Extending WP
Extending WP Adding Scripts (jQuery, etc.)
Extending WP The “Wrong” Way
Extending WP
Extending WP The Right Way
Extending WP
Extending WP
Extending WP
Extending WP Real Example
Extending WP 2 Other Really Cool Things
Extending WP Transient API & WP Events (Cron)
Extending WP Transient API
Extending WP WP Events
Extending WP Also check out WP Object Cache and plugin caching solutions like WP Super Cache and W3 Total Cache.
ANY ?’s
WordPress Bootcamp Part 2 - Extending WordPress

WordPress Bootcamp Part 2 - Extending WordPress