35

WordPress Plugins

Embed Size (px)

Citation preview

Page 1: WordPress Plugins
Page 2: WordPress Plugins

About Me• Web Developer – imaginuity.com

Links

Personal Contact –

Presentation –

http://randyhoyt.com@randyhoyt

http://r2h.me/plugins

Page 3: WordPress Plugins

WordPress 1.2http://wordpress.org/news/2004/05/heres-the-beef/

Page 4: WordPress Plugins

WordPress 1.2 – New Plugin Architecturehttp://wordpress.org/news/2004/05/heres-the-beef/

Page 5: WordPress Plugins

About Me• Web Developer – imaginuity.com

Plugin Architecture

Hooks: - Pre-defined places in WordPress where plugins and

themes can inject their own code

Two Types of Hooks:- Filters – For modifying various pieces of text- Actions – For executing code triggered by an event

Page 6: WordPress Plugins

About Me• Web Developer – imaginuity.com

Filters

• Modify pieces of text that WordPress generates

• Functions:

- add_filter( $tag, $new_function, $priority, $accepted_args );- Applies a function to a filter hook- http://codex.wordpress.org/Function_Reference/add_filter

- remove_filter( $tag, $new_function, $priority, $accepted_args );- Removes a function from a filter hook to which it has been added- http://codex.wordpress.org/Function_Reference/remove_filter

Page 7: WordPress Plugins

About Me• Web Developer – imaginuity.com

Filters: Examples

the_content - applied to the post content retrieved from the database, prior to printing

on the screen

wp_list_pages- applied to the HTML list generated by the wp_list_pages function

single_template, archive_template, etc.- plugins can modify the template files to be used with a filter returning the

path to a new template file

Page 8: WordPress Plugins

• Screenshot TwentyTen

WP Tweet Buttonhttp://wordpress.org/extend/plugins/wp-tweet-button/

Page 9: WordPress Plugins

• Screenshot TwentyTen

198 add_filter('the_content', array(&$this, 'tw_update'));

578 function tw_update($content) {612 $button = $this->tw_generate_button();621 return $button . $content;634 }

Page 10: WordPress Plugins

Hoyt FamilyPassword-Protected Blog

Page 11: WordPress Plugins

Hoyt Family

function RRH_rss_remove_excerpt( $output ) { return "Please log in to our family web site to view this update."; } add_filter('the_excerpt_rss', 'RRH_rss_remove_excerpt');

Page 12: WordPress Plugins

Remove Wordpress to WordPress filterhttp://wordpress.org/extend/plugins/remove-wordpress-to-wordpress-filter/

Page 13: WordPress Plugins

remove_filter('the_content','capital_P_dangit',11);remove_filter('the_title','capital_P_dangit',11);remove_filter('comment_text','capital_P_dangit',11);

Remove Wordpress to WordPress filterhttp://wordpress.org/extend/plugins/remove-wordpress-to-wordpress-filter/

Page 14: WordPress Plugins

About Me• Web Developer – imaginuity.com

Actions

• Execute code when an event in WordPress occurs

• Functions:

- add_action( $tag, $new_function, $priority, $accepted_args );- Applies a function to a filter hook- http://codex.wordpress.org/Function_Reference/add_action

- remove_action( $tag, $new_function, $priority, $accepted_args );- Removes a function from a filter hook to which it has been added- http://codex.wordpress.org/Function_Reference/remove_action

Page 15: WordPress Plugins

About Me• Web Developer – imaginuity.com

Actions: Examples

the_content - applied to the post content retrieved from the database, prior to printing

on the screen

wp_list_pages- applied to the HTML list generated by the wp_list_pages function

single_template, archive_template, etc.- plugins can modify the template files to be used with a filter returning the

path to a new template file

Page 16: WordPress Plugins

• Admin Favicon

Admin Faviconhttp://wordpress.org/extend/plugins/admin-favicon/

Page 17: WordPress Plugins

function Adminfavicon() { $options = get_option('favi_insert_url'); echo '<link rel="shortcut icon" href="' . $options[favi_url] . '" />';}add_action('admin_head', 'Adminfavicon');

Admin Faviconhttp://wordpress.org/extend/plugins/admin-favicon/

Page 18: WordPress Plugins

• Redirector

Redirectorhttp://wordpress.org/extend/plugins/redirector/

Page 19: WordPress Plugins

• Redirector

Redirectorhttp://wordpress.org/extend/plugins/redirector/

Page 20: WordPress Plugins

function re_adminhead(){

add_meta_box('redirect', __('Redirect','redirector'), 're_metabox', 'page');}add_action('admin_head', 're_adminhead');

add_action('save_post', 're_meta_save');function re_meta_save(){ $redirect_to = $_POST['redirector']; if ($redirect_to)

update_post_meta($_POST['ID'], 'redirector', $redirect_to); else

delete_post_meta($_POST['ID'], 'redirector');}

Redirectorhttp://wordpress.org/extend/plugins/redirector/

Page 21: WordPress Plugins

WP Tutorial: Your First WP Pluginhttp://markjaquith.wordpress.com/2006/03/04/wp-tutorial-your-first-wp-plugin/

Page 22: WordPress Plugins

About Me• Web Developer – imaginuity.comPlugins

vs.

functions.php

Page 23: WordPress Plugins
Page 24: WordPress Plugins

WP-PageNavihttp://wordpress.org/extend/plugins/wp-pagenavi/

Page 25: WordPress Plugins

Maintenance Modehttp://wordpress.org/extend/plugins/maintenance-mode/

Page 26: WordPress Plugins

Theme My Login & Theme My Profilehttp://profiles.wordpress.org/users/jfarthing84/

Page 27: WordPress Plugins

KB Advanced RSS Widgethttp://wordpress.org/extend/plugins/kb-advanced-rss-widget/

Page 28: WordPress Plugins

KB Advanced RSS Widgethttp://wordpress.org/extend/plugins/kb-advanced-rss-widget/

Page 29: WordPress Plugins

Analytics360°http://wordpress.org/extend/plugins/analytics360/

Page 30: WordPress Plugins

Query Postshttp://wordpress.org/extend/plugins/query-posts/

Page 31: WordPress Plugins

Query Postshttp://wordpress.org/extend/plugins/query-posts/

Page 32: WordPress Plugins

TweetOnPosthttp://wordpress.org/extend/plugins/tweetonpost/

Page 33: WordPress Plugins

Wordbookerhttp://wordpress.org/extend/plugins/wordbooker/

• WordBooker• Twitter on Post• Contact Form 7 / Gravity Forms

Page 34: WordPress Plugins

Gravity Formshttp://www.gravityforms.com/

Page 35: WordPress Plugins