WordPress Plugin Development Cheat Sheets
WordPress has many hooks that you as a plugin developer can take advantage of while developing a plugin. This page documents the API (Application Programming Interface) hooks available to WordPress plugin developers. This article is specifically about the API of “Hooks”, also known as “Filters” and “Actions”, that WordPress uses to set your plugin in motion.
Available “add_action” Hooks
Actions are (usually) triggered when the WordPress core calls do_action(). It can be used in the following way:
add_action ('hook_name', 'your_function_name', [priority] , [accepted_args]);
- admin_footer
- admin_head
- admin_menu
- comment_closed
- comment_form
- comment_id_not_found
- comment_post
- delete_comment
- delete_post
- edit_comment
- edit_page_form
- edit_post
- private_to_published
- generate_rewrite_rules
- init
- pingback_post
- publish_phone
- publish_post
- save_post
- shutdown
- simple_edit_form
- switch_theme
- template_redirect
- wp_footer
- wp_head
- wp_meta
- wp_set_comment_status
Available “add_filter” Hooks
Hooks a function to a specific filter action.
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. Plugins 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.
The following example shows how a filter can be used:
add_filter ('hook_name', 'your_filter', [priority], [accepted_args]);
- author_email
- posts_where
- the_excerpt_rss
- bloginfo
- posts_where_paged
- the_posts
- category_description
- posts_join
- the_time
- comment_author
- posts_join_paged
- the_title
- comment_edit_pre
- post_link
- the_title_rss
- comment_email
- posts_orderby
- the_weekday
- comment_excerpt
- preprocess_comment
- the_weekday_date
- comment_save_pre
- pre_comment_approved
- title_edit_pre
- comments_number
- pre_comment_author_name
- xmlrpc_methods
- comment_text
- pre_comment_author_email
- mce_browsers
- content_edit_pre
- pre_comment_content
- mce_plugins
- content_save_pre
- pre_comment_user_agent
- mce_valid_elements
- default_content
- pre_comment_user_domain
- mce_buttons
- default_excerpt
- pre_comment_user_ip
- mce_buttons_2
- default_title
- query_string
- mce_buttons_3
- excerpt_edit_pre
- register
- excerpt_save_pre r
- ewrite_rules
- format_to_edit
- rewrite_ruelse_array
- format_to_post
- sanitize_title
- get_comment_author_url
- single_post_title
- get_comment_author_link
- stylesheet
- link_rating
- template
- list_cats
- the_category
- loginout
- the_category_rss
- mod_rewrite_rules
- the_content
- page_link
- the_date
- phone_content
- the_excerpt
Available Hooks for the Admin Menu
Usually, plugin and theme authors need to provide access to a settings (options) screen so users can customize how the plugin or theme is used. The best way to present the user with such a screen is to create an administration menu item that allows the user to access that settings screen.
- add_submenu_page()
- add_options_page()
- add_management_page()
- add_menu_page()
Available Options Functions
Options are pieces of data that WordPress uses to store various preferences and configuration settings.
- update_option()
- get_option()
- add_option()
- delete_option()
Available Database Operation Functions
The following functions can be used on the $wpdb object for various database operations:
- query()
- get_var()
- get_row()
- get_col()
- get_results()
- escape()
- show_errors()
- hide_errors()
- get_col_info()
- flush()
Please let me now if I have missed something.
Related posts:
Tags: Cheat Sheet, php, plugins, Wordpress









LOVE it! Extremely Helpful Thanks for Sharing!
Leave your response!