This is a (hopefully) comprehensive list of action hooks available in WordPress version 2.1 and above. For more information:
- To learn more about what filter and action hooks are, see Plugin API.
- To learn about writing plugins in general, see Plugin Handbook.
- For a reference list of filter hooks, see Plugin API/Filter Reference.
(If you want to add to or clarify this documentation, please follow the style of the existing entries. Describe when the action runs, and if the action function takes arguments, describe the arguments.)
Actions Run During a Typical Request
These actions are called when a logged-in user opens the home page, this list may be outdated. This list may show only the first time each action is called, and in many cases no function is hooked to the action. Themes and plugins can cause actions to be called multiple times and at differing times during a request. As proof of this, you can see action calls specific to the Twenty Eleven theme on this list. Cron tasks may also fire when a user visits the site, adding additional action calls. This list should be viewed as a guide line or approximation of WordPress action execution order, and not a concrete specification.
Actions are called with the function do_action(), except those marked (ref array), which are called with the function do_action_ref_array().
| muplugins_loaded | After must-use plugins are loaded. |
| registered_taxonomy | For category, post_tag, etc. |
| registered_post_type | For post, page, etc. |
| plugins_loaded | After active plugins and before pluggable functions are loaded. |
| sanitize_comment_cookies | When comment cookies are sanitized. |
| setup_theme | Before the theme is loaded. |
| load_textdomain | For the default domain |
| after_setup_theme | Generally used to initialize theme settings/options. This is the first action hook available to themes, triggered immediately after the active theme’s functions.php file is loaded. add_theme_support() should be called here, since the init action hook is too late to add some features. At this stage, the current user is not yet authenticated. |
| auth_cookie_malformed | |
| auth_cookie_valid | |
| set_current_user | |
| init | Typically used by plugins to initialize. The current user is already authenticated by this time. |
| └─ widgets_init | Used to register sidebars. Fired at ‘init’ priority 1 (and so before ‘init’ actions with priority ≥ 1!) |
| register_sidebar | For each sidebar and footer area |
| wp_register_sidebar_widget | For each widget |
| wp_default_scripts | (ref array) |
| wp_default_styles | (ref array) |
| admin_bar_init | |