Calls the callback functions that have been added to an action hook.
Description
This function invokes all functions attached to action hook $hook_name
.
It is possible to create new action hooks by simply calling this function, specifying the name of the new hook using the $hook_name
parameter.
You can pass extra arguments to the hooks, much like you can with apply_filters()
.
Example usage:
// The action callback function.
function example_callback( $arg1, $arg2 ) {
// (maybe) do something with the args.
}
add_action( 'example_action', 'example_callback', 10, 2 );
/*
* Trigger the actions by calling the 'example_callback()' function
* that's hooked onto `example_action` above.
*
* - 'example_action' is the action hook.
* - $arg1 and $arg2 are the additional arguments passed to the callback.
do_action( 'example_action', $arg1, $arg2 );
Parameters
$hook_name
stringrequired- The name of the action to be executed.
$arg
mixedoptional- Additional arguments which are passed on to the functions hooked to the action. Default empty.
Source
function do_action( $hook_name, ...$arg ) {
global $wp_filter, $wp_actions, $wp_current_filter;
if ( ! isset( $wp_actions[ $hook_name ] ) ) {
$wp_actions[ $hook_name ] = 1;
} else {
++$wp_actions[ $hook_name ];
}
// Do 'all' actions first.
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
if ( empty( $arg ) ) {
$arg[] = '';
} elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
// Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
$arg[0] = $arg[0][0];
}
$wp_filter[ $hook_name ]->do_action( $arg );
array_pop( $wp_current_filter );
}
Related
Uses | Description |
---|---|
_wp_call_all_hook()wp-includes/plugin.php | Calls the ‘all’ hook, which will process the functions hooked into it. |
Used by | Description |
---|---|
wp_admin_notice()wp-includes/functions.php | Outputs an admin notice. |
wp_trigger_error()wp-includes/functions.php | Generates a user-level error/warning/notice/deprecation message. |
_deprecated_class()wp-includes/functions.php | Marks a class as deprecated and informs when it has been used. |
wp_cache_set_last_changed()wp-includes/functions.php | Sets last changed date for the specified cache group to now. |
_wp_get_iframed_editor_assets()wp-includes/block-editor.php | Collect the block editor assets that need to be loaded into the editor’s iframe. |
WP_REST_Menu_Items_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Creates a single nav menu item. |
WP_REST_Menu_Items_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Updates a single nav menu item. |
WP_REST_Menu_Items_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php | Deletes a single nav menu item. |
WP_REST_Menus_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Creates a single term in a taxonomy. |
WP_REST_Menus_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Updates a single term from a taxonomy. |
WP_REST_Menus_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Deletes a single term from a taxonomy. |
WP_REST_Menus_Controller::handle_auto_add()wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php | Updates the menu’s auto add from a REST request. |
WP_REST_Widgets_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php | Deletes a widget. |
WP_REST_Widgets_Controller::save_widget()wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php | Saves the widget in the request object. |
WP_REST_Sidebars_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php | Updates a sidebar. |
WP_REST_Templates_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Updates a single template. |
WP_REST_Templates_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php | Creates a single template. |
wp_render_widget()wp-includes/widgets.php | Calls the render callback of a widget and returns the output. |
WP_REST_Application_Passwords_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php | Creates an application password. |
WP_REST_Application_Passwords_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php | Updates an application password. |
WP_Application_Passwords::delete_application_password()wp-includes/class-wp-application-passwords.php | Deletes an application password. |
WP_Application_Passwords::delete_all_application_passwords()wp-includes/class-wp-application-passwords.php | Deletes all application passwords for the given user. |
WP_Application_Passwords::create_new_application_password()wp-includes/class-wp-application-passwords.php | Creates a new application password. |
WP_Application_Passwords::update_application_password()wp-includes/class-wp-application-passwords.php | Updates an application password. |
wp_authenticate_application_password()wp-includes/user.php | Authenticates the user using an application password. |
wp_after_insert_post()wp-includes/post.php | Fires actions after a post, its terms and meta data has been saved. |
WP_Application_Passwords_List_Table::column_default()wp-admin/includes/class-wp-application-passwords-list-table.php | Generates content for a single row of the table |
WP_Application_Passwords_List_Table::print_js_template_row()wp-admin/includes/class-wp-application-passwords-list-table.php | Prints the JavaScript template for the new row item. |
wp_is_authorize_application_password_request_valid()wp-admin/includes/user.php | Checks if the Authorize Application Password request is valid. |
core_auto_updates_settings()wp-admin/update-core.php | Display WordPress auto-updates settings. |
wp_check_comment_disallowed_list()wp-includes/comment.php | Checks if a comment contains disallowed characters or words. |
wp_sitemaps_get_server()wp-includes/sitemaps.php | Retrieves the current Sitemaps server instance. |
do_favicon()wp-includes/functions.php | Displays the favicon.ico file content. |
WP_REST_Attachments_Controller::insert_attachment()wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Inserts the attachment post in the database. Does not update the attachment meta. |
WP_MS_Sites_List_Table::extra_tablenav()wp-admin/includes/class-wp-ms-sites-list-table.php | Displays extra controls between bulk actions and pagination. |
WP_Recovery_Mode_Key_Service::generate_and_store_recovery_mode_key()wp-includes/class-wp-recovery-mode-key-service.php | Creates a recovery mode key. |
wp_body_open()wp-includes/general-template.php | Fires the wp_body_open action. |
wp_maybe_transition_site_statuses_on_update()wp-includes/ms-site.php | Triggers actions on site status updates. |
wp_prepare_site_data()wp-includes/ms-site.php | Prepares site data for insertion or update in the database. |
wp_insert_site()wp-includes/ms-site.php | Inserts a new site into the database. |
wp_update_site()wp-includes/ms-site.php | Updates a site in the database. |
wp_delete_site()wp-includes/ms-site.php | Deletes a site from the database. |
WP_REST_Autosaves_Controller::create_post_autosave()wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php | Creates autosave for the specified post. |
wp_common_block_scripts_and_styles()wp-includes/script-loader.php | Handles the enqueueing of block scripts and styles that are common to both the editor and the front-end. |
the_block_editor_meta_box_post_form_hidden_fields()wp-admin/includes/post.php | Renders the hidden form required for the meta boxes form. |
register_and_do_post_meta_boxes()wp-admin/includes/meta-boxes.php | Registers the default post meta boxes, and runs the |
wp_privacy_process_personal_data_export_page()wp-admin/includes/privacy-tools.php | Intercept personal data exporter page Ajax responses in order to assemble the personal data export file. |
wp_privacy_generate_personal_data_export_file()wp-admin/includes/privacy-tools.php | Generate the personal data export file. |
WP_Privacy_Requests_Table::column_default()wp-admin/includes/class-wp-privacy-requests-table.php | Handles the default column. |
wp_privacy_process_personal_data_erasure_page()wp-admin/includes/privacy-tools.php | Mark erasure requests as completed after processing is finished. |
WP_Customize_Manager::trash_changeset_post()wp-includes/class-wp-customize-manager.php | Trashes or deletes a changeset post. |
clean_taxonomy_cache()wp-includes/taxonomy.php | Cleans the caches for a taxonomy. |
wp_enqueue_code_editor()wp-includes/general-template.php | Enqueues assets needed by the code editor for the given settings. |
WP_Roles::init_roles()wp-includes/class-wp-roles.php | Initializes all of the available roles. |
_WP_Editors::print_default_editor_scripts()wp-includes/class-wp-editor.php | Print (output) all editor scripts and default settings. |
WP_Customize_Manager::_publish_changeset_values()wp-includes/class-wp-customize-manager.php | Publishes the values of a changeset. |
WP_Customize_Manager::save_changeset_post()wp-includes/class-wp-customize-manager.php | Saves the post for the loaded changeset. |
_wp_customize_publish_changeset()wp-includes/theme.php | Publishes a snapshot’s changes. |
WP_REST_Users_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Deletes a single user. |
WP_REST_Users_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Creates a single user. |
WP_REST_Users_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php | Updates a single user. |
WP_REST_Revisions_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Deletes a single revision. |
WP_REST_Attachments_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Creates a single attachment. |
WP_REST_Attachments_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php | Updates a single attachment. |
WP_REST_Terms_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Deletes a single term from a taxonomy. |
WP_REST_Terms_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Creates a single term in a taxonomy. |
WP_REST_Terms_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php | Updates a single term from a taxonomy. |
WP_REST_Posts_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Creates a single post. |
WP_REST_Posts_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Updates a single post. |
WP_REST_Posts_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Deletes a single post. |
WP_REST_Comments_Controller::update_item()wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Updates a comment. |
WP_REST_Comments_Controller::delete_item()wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Deletes a comment. |
WP_REST_Comments_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Creates a comment. |
WP_Locale_Switcher::change_locale()wp-includes/class-wp-locale-switcher.php | Changes the site’s locale to the given one. |
WP_Locale_Switcher::switch_to_locale()wp-includes/class-wp-locale-switcher.php | Switches the translations according to the given locale. |
WP_Locale_Switcher::restore_previous_locale()wp-includes/class-wp-locale-switcher.php | Restores the translations according to the previous locale. |
wp_check_comment_flood()wp-includes/comment.php | Checks whether comment flooding is occurring. |
WP_Term_Query::parse_query()wp-includes/class-wp-term-query.php | Parse arguments passed to the term query with default query parameters. |
clean_network_cache()wp-includes/ms-network.php | Removes a network from the object cache. |
_deprecated_hook()wp-includes/functions.php | Marks a deprecated action or filter hook as deprecated and throws a notice. |
ms_load_current_site_and_network()wp-includes/ms-load.php | Identifies the network and site of a requested domain and path and populates the corresponding network and site global objects as part of the multisite bootstrap process. |
rest_get_server()wp-includes/rest-api.php | Retrieves the current REST server instance. |
WP_Metadata_Lazyloader::queue_objects()wp-includes/class-wp-metadata-lazyloader.php | Adds objects to the metadata lazy-load queue. |
unregister_taxonomy()wp-includes/taxonomy.php | Unregisters a taxonomy. |
unregister_post_type()wp-includes/post.php | Unregisters a post type. |
WP_Customize_Selective_Refresh::handle_render_partials_request()wp-includes/customize/class-wp-customize-selective-refresh.php | Handles the Ajax request to return the rendered partials for the requested placements. |
enqueue_embed_scripts()wp-includes/embed.php | Enqueues embed iframe default CSS and JS. |
get_password_reset_key()wp-includes/user.php | Creates, stores, then returns a password reset key for user. |
wp_handle_comment_submission()wp-includes/comment.php | Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form. |
update_network_option()wp-includes/option.php | Updates the value of a network option that was already added. |
add_network_option()wp-includes/option.php | Adds a new network option. |
delete_network_option()wp-includes/option.php | Removes a network option by name. |
wp_ajax_delete_inactive_widgets()wp-admin/includes/ajax-actions.php | Handles removing inactive widgets via AJAX. |
WP_Customize_Nav_Menu_Item_Control::content_template()wp-includes/customize/class-wp-customize-nav-menu-item-control.php | JS/Underscore template for the control UI. |
_deprecated_constructor()wp-includes/functions.php | Marks a constructor as deprecated and informs when it has been used. |
WP_Posts_List_Table::column_default()wp-admin/includes/class-wp-posts-list-table.php | Handles the default column output. |
WP_Links_List_Table::column_default()wp-admin/includes/class-wp-links-list-table.php | Handles the default column output. |
WP_MS_Themes_List_Table::column_default()wp-admin/includes/class-wp-ms-themes-list-table.php | Handles default column output. |
wp_ajax_crop_image()wp-admin/includes/ajax-actions.php | Handles cropping an image via AJAX. |
WP_MS_Sites_List_Table::column_default()wp-admin/includes/class-wp-ms-sites-list-table.php | Handles output for the default column. |
WP_MS_Sites_List_Table::column_plugins()wp-admin/includes/class-wp-ms-sites-list-table.php | Handles the plugins column output. |
WP_Media_List_Table::column_default()wp-admin/includes/class-wp-media-list-table.php | Handles output for the default column. |
WP_Customize_Manager::set_post_value()wp-includes/class-wp-customize-manager.php | Overrides a setting’s value in the current customized state. |
wp_media_attach_action()wp-admin/includes/media.php | Encapsulates the logic for Attach/Detach actions. |
WP_Customize_Panel::maybe_render()wp-includes/class-wp-customize-panel.php | Check capabilities and render the panel. |
login_footer()wp-login.php | Outputs the footer for the login page. |
retrieve_password()wp-includes/user.php | Handles sending a password retrieval email to a user. |
login_header()wp-login.php | Outputs the login page header. |
show_user_form()wp-signup.php | Displays the fields for the new user account registration form. |
signup_another_blog()wp-signup.php | Shows a form for returning users to sign up for another site. |
confirm_another_blog_signup()wp-signup.php | Shows a message confirming that the new site has been created. |
signup_user()wp-signup.php | Shows a form for a visitor to sign up for a new user account. |
confirm_user_signup()wp-signup.php | Shows a message confirming that the new user has been registered and is awaiting activation. |
signup_blog()wp-signup.php | Shows a form for a user or visitor to sign up for a new site. |
confirm_blog_signup()wp-signup.php | Shows a message confirming that the new site has been registered and is awaiting activation. |
do_signup_header()wp-signup.php | Prints signup_header via wp_head. |
show_blog_form()wp-signup.php | Generates and displays the Sign-up and Create Site forms. |
display_setup_form()wp-admin/install.php | Displays installer setup form. |
WP_Automatic_Updater::update()wp-admin/includes/class-wp-automatic-updater.php | Updates an item, if appropriate. |
WP_Automatic_Updater::run()wp-admin/includes/class-wp-automatic-updater.php | Kicks off the background update process, looping through all pending updates. |
Core_Upgrader::upgrade()wp-admin/includes/class-core-upgrader.php | Upgrades WordPress core. |
Language_Pack_Upgrader::bulk_upgrade()wp-admin/includes/class-language-pack-upgrader.php | Upgrades several language packs at once. |
Plugin_Upgrader::bulk_upgrade()wp-admin/includes/class-plugin-upgrader.php | Upgrades several plugins at once. |
Theme_Upgrader::install()wp-admin/includes/class-theme-upgrader.php | Install a theme package. |
Theme_Upgrader::bulk_upgrade()wp-admin/includes/class-theme-upgrader.php | Upgrades several themes at once. |
WP_Upgrader::run()wp-admin/includes/class-wp-upgrader.php | Runs an upgrade/installation. |
Plugin_Upgrader::install()wp-admin/includes/class-plugin-upgrader.php | Install a plugin package. |
delete_theme()wp-admin/includes/theme.php | Removes a theme. |
WP_Screen::set_current_screen()wp-admin/includes/class-wp-screen.php | Makes the screen object the current screen. |
WP_Plugins_List_Table::single_row()wp-admin/includes/class-wp-plugins-list-table.php | |
grant_super_admin()wp-includes/capabilities.php | Grants Super Admin privileges. |
revoke_super_admin()wp-includes/capabilities.php | Revokes Super Admin privileges. |
wpmu_delete_user()wp-admin/includes/ms.php | Deletes a user and all of their posts from the network. |
update_user_status()wp-includes/ms-deprecated.php | Update the status of a user in the database. |
WP_MS_Themes_List_Table::single_row()wp-admin/includes/class-wp-ms-themes-list-table.php | |
populate_options()wp-admin/includes/schema.php | Create WordPress options and set the default values. |
WP_Theme_Install_List_Table::display()wp-admin/includes/class-wp-theme-install-list-table.php | Displays the theme install table. |
wp_plugin_update_row()wp-admin/includes/update.php | Displays update information for a plugin. |
wp_theme_update_row()wp-admin/includes/update.php | Displays update information for a theme. |
wp_dashboard_right_now()wp-admin/includes/dashboard.php | Dashboard widget that displays some basic stats about the site. |
wp_network_dashboard_right_now()wp-admin/includes/dashboard.php | |
wp_dashboard_setup()wp-admin/includes/dashboard.php | Registers dashboard widgets. |
wp_upgrade()wp-admin/includes/upgrade.php | Runs WordPress Upgrade functions. |
wp_install()wp-admin/includes/upgrade.php | Installs the site. |
register_setting()wp-includes/option.php | Registers a setting and its data. |
unregister_setting()wp-includes/option.php | Unregisters a setting. |
uninstall_plugin()wp-admin/includes/plugin.php | Uninstalls a single plugin. |
deactivate_plugins()wp-admin/includes/plugin.php | Deactivates a single plugin or multiple plugins. |
delete_plugins()wp-admin/includes/plugin.php | Removes directory and files of a plugin for a list of plugins. |
activate_plugin()wp-admin/includes/plugin.php | Attempts activation of plugin in a “sandbox” and redirects on success. |
edit_user()wp-admin/includes/user.php | Edit user settings based on contents of $_POST |
wp_delete_user()wp-admin/includes/user.php | Delete user and optionally reassign posts and links to another user. |
WP_Plugin_Install_List_Table::display_tablenav()wp-admin/includes/class-wp-plugin-install-list-table.php | |
_wp_admin_html_begin()wp-admin/includes/template.php | Prints out the beginning of the admin HTML header. |
iframe_header()wp-admin/includes/template.php | Generic Iframe header for use with Thickbox. |
iframe_footer()wp-admin/includes/template.php | Generic Iframe footer for use with Thickbox. |
get_inline_data()wp-admin/includes/template.php | Adds hidden fields with the data for use in the inline editor for posts and pages. |
WP_Users_List_Table::extra_tablenav()wp-admin/includes/class-wp-users-list-table.php | Outputs the controls to allow user roles to be changed in bulk. |
edit_form_image_editor()wp-admin/includes/media.php | Displays the image and editor in the post editor |
media_upload_form()wp-admin/includes/media.php | Outputs the legacy media upload form. |
wp_iframe()wp-admin/includes/media.php | Outputs the iframe to display the media upload page. |
_admin_notice_post_locked()wp-admin/includes/post.php | Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post. |
wp_create_post_autosave()wp-admin/includes/post.php | Creates autosave data for the specified post from |
bulk_edit_posts()wp-admin/includes/post.php | Processes the post data for the bulk editing of posts. |
wp_ajax_heartbeat()wp-admin/includes/ajax-actions.php | Handles the Heartbeat API via AJAX. |
wp_ajax_save_widget()wp-admin/includes/ajax-actions.php | Handles saving a widget via AJAX. |
wp_ajax_nopriv_heartbeat()wp-admin/includes/ajax-actions.php | Handles the Heartbeat API in the no-privilege context via AJAX . |
update_core()wp-admin/includes/update-core.php | Upgrades the core of WordPress. |
post_comment_status_meta_box()wp-admin/includes/meta-boxes.php | Displays comments status form fields. |
page_attributes_meta_box()wp-admin/includes/meta-boxes.php | Displays page attributes form fields. |
link_submit_meta_box()wp-admin/includes/meta-boxes.php | Displays link create form fields. |
wp_insert_link()wp-admin/includes/bookmark.php | Inserts a link into the database, or updates an existing link. |
post_submit_meta_box()wp-admin/includes/meta-boxes.php | Displays post submit form fields. |
attachment_submit_meta_box()wp-admin/includes/meta-boxes.php | Displays attachment submit form fields. |
wp_delete_link()wp-admin/includes/bookmark.php | Deletes a specified link from the database. |
WP_Media_List_Table::extra_tablenav()wp-admin/includes/class-wp-media-list-table.php | |
WP_Comments_List_Table::column_default()wp-admin/includes/class-wp-comments-list-table.php | |
WP_Comments_List_Table::extra_tablenav()wp-admin/includes/class-wp-comments-list-table.php | |
WP_Terms_List_Table::inline_edit()wp-admin/includes/class-wp-terms-list-table.php | Outputs the hidden row displayed when inline editing |
Walker_Nav_Menu_Edit::start_el()wp-admin/includes/class-walker-nav-menu-edit.php | Start the element output. |
wp_nav_menu_update_menu_items()wp-admin/includes/nav-menu.php | Saves nav menu items. |
WP_Posts_List_Table::inline_edit()wp-admin/includes/class-wp-posts-list-table.php | Outputs the hidden row displayed when inline editing |
WP_Posts_List_Table::extra_tablenav()wp-admin/includes/class-wp-posts-list-table.php | |
Custom_Image_Header::step_1()wp-admin/includes/class-custom-image-header.php | Displays first step of custom header image page. |
confirm_delete_users()wp-admin/includes/ms.php | |
do_activate_header()wp-activate.php | Adds an action hook specific to this page. |
WP_User::add_role()wp-includes/class-wp-user.php | Adds role to user. |
WP_User::remove_role()wp-includes/class-wp-user.php | Removes role from user. |
WP_User::set_role()wp-includes/class-wp-user.php | Sets the role of the user. |
WP_Customize_Manager::customize_preview_init()wp-includes/class-wp-customize-manager.php | Prints JavaScript settings. |
WP_Customize_Manager::start_previewing_theme()wp-includes/class-wp-customize-manager.php | If the theme to be previewed isn’t the active theme, add filter callbacks to swap it out at runtime. |
WP_Customize_Manager::stop_previewing_theme()wp-includes/class-wp-customize-manager.php | Stops previewing the selected theme. |
WP_Customize_Manager::wp_loaded()wp-includes/class-wp-customize-manager.php | Registers styles/scripts and initialize the preview of each setting |
check_theme_switched()wp-includes/theme.php | Checks if a theme has been changed and runs ‘after_switch_theme’ hook on the next WP load. |
switch_theme()wp-includes/theme.php | Switches the theme. |
wp_set_password()wp-includes/pluggable.php | Updates the user’s password with a new hashed one. |
wp_verify_nonce()wp-includes/pluggable.php | Verifies that a correct security nonce was used with time limit. |
wp_set_auth_cookie()wp-includes/pluggable.php | Sets the authentication cookies based on user ID. |
wp_clear_auth_cookie()wp-includes/pluggable.php | Removes all of the cookies associated with authentication. |
auth_redirect()wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
check_admin_referer()wp-includes/pluggable.php | Ensures intent by verifying that a user was referred from another admin page with the correct security nonce. |
check_ajax_referer()wp-includes/pluggable.php | Verifies the Ajax request to prevent processing requests external of the blog. |
wp_authenticate()wp-includes/pluggable.php | Authenticates a user, confirming the login credentials are valid. |
wp_logout()wp-includes/pluggable.php | Logs the current user out. |
wp_validate_auth_cookie()wp-includes/pluggable.php | Validates authentication cookie. |
wp_set_current_user()wp-includes/pluggable.php | Changes the current user by ID or name. |
wp_mail()wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
wp_head()wp-includes/general-template.php | Fires the wp_head action. |
wp_footer()wp-includes/general-template.php | Fires the wp_footer action. |
wp_meta()wp-includes/general-template.php | Theme container function for the ‘wp_meta’ action. |
get_header()wp-includes/general-template.php | Loads header template. |
get_footer()wp-includes/general-template.php | Loads footer template. |
get_sidebar()wp-includes/general-template.php | Loads sidebar template. |
get_template_part()wp-includes/general-template.php | Loads a template part into a template. |
get_search_form()wp-includes/general-template.php | Displays search form. |
delete_usermeta()wp-includes/deprecated.php | Remove user meta data. |
update_usermeta()wp-includes/deprecated.php | Update metadata of user. |
WP_Query::have_posts()wp-includes/class-wp-query.php | Determines whether there are more posts available in the loop. |
WP_Query::the_comment()wp-includes/class-wp-query.php | Sets up the current comment. |
WP_Query::get_posts()wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables. |
WP_Query::parse_tax_query()wp-includes/class-wp-query.php | Parses various taxonomy related query vars. |
shutdown_action_hook()wp-includes/load.php | Runs just before PHP shuts down execution. |
WP_Http::_dispatch_request()wp-includes/class-wp-http.php | Dispatches a HTTP request to a supporting transport. |
WP_Http::request()wp-includes/class-wp-http.php | Send an HTTP request to a URI. |
wp_print_scripts()wp-includes/functions.wp-scripts.php | Prints scripts in document head that are in the $handles queue. |
_deprecated_function()wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
_deprecated_file()wp-includes/functions.php | Marks a file as deprecated and inform when it has been used. |
_doing_it_wrong()wp-includes/functions.php | Marks something as being incorrectly called. |
_deprecated_argument()wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
do_robots()wp-includes/functions.php | Displays the default robots.txt file content. |
do_feed()wp-includes/functions.php | Loads the feed template from the use of an action hook. |
wp_widgets_init()wp-includes/widgets.php | Registers all of the default WordPress widgets on startup. |
WP_Customize_Section::maybe_render()wp-includes/class-wp-customize-section.php | Check capabilities and render the section. |
_update_post_term_count()wp-includes/taxonomy.php | Updates term count based on object types of the current taxonomy. |
_update_generic_term_count()wp-includes/taxonomy.php | Updates term count based on number of objects. |
clean_object_term_cache()wp-includes/taxonomy.php | Removes the taxonomy relationship to terms from the cache. |
clean_term_cache()wp-includes/taxonomy.php | Removes all of the term IDs from the cache. |
wp_update_term()wp-includes/taxonomy.php | Updates term based on arguments provided. |
wp_set_object_terms()wp-includes/taxonomy.php | Creates term and taxonomy relationships. |
wp_remove_object_terms()wp-includes/taxonomy.php | Removes term(s) associated with a given object. |
wp_insert_term()wp-includes/taxonomy.php | Adds a new term to the database. |
wp_delete_term()wp-includes/taxonomy.php | Removes a term from the database. |
register_taxonomy()wp-includes/taxonomy.php | Creates or modifies a taxonomy object. |
register_taxonomy_for_object_type()wp-includes/taxonomy.php | Adds an already registered taxonomy to an object type. |
unregister_taxonomy_for_object_type()wp-includes/taxonomy.php | Removes an already registered taxonomy from an object type. |
WP_Admin_Bar::add_menus()wp-includes/class-wp-admin-bar.php | Adds menus to the admin bar. |
WP_Admin_Bar::initialize()wp-includes/class-wp-admin-bar.php | Initializes the admin bar. |
wp_version_check()wp-includes/update.php | Checks WordPress version against the newest version. |
wp_print_styles()wp-includes/functions.wp-styles.php | Displays styles that are in the $handles queue. |
wp_admin_bar_render()wp-includes/admin-bar.php | Renders the admin bar to the page based on the $wp_admin_bar->menu member var. |
WP_Customize_Setting::preview()wp-includes/class-wp-customize-setting.php | Add filters to supply the setting’s value when accessed. |
WP_Customize_Setting::save()wp-includes/class-wp-customize-setting.php | Checks user capabilities and theme supports, and then saves the value of the setting. |
WP_Customize_Setting::update()wp-includes/class-wp-customize-setting.php | Save the value of the setting, using the related API. |
set_site_transient()wp-includes/option.php | Sets/updates the value of a site transient. |
delete_site_transient()wp-includes/option.php | Deletes a site transient. |
set_transient()wp-includes/option.php | Sets/updates the value of a transient. |
update_option()wp-includes/option.php | Updates the value of an option that was already added. |
add_option()wp-includes/option.php | Adds a new option. |
delete_option()wp-includes/option.php | Removes an option by name. Prevents removal of protected WordPress options. |
delete_transient()wp-includes/option.php | Deletes a transient. |
wp_update_user()wp-includes/user.php | Updates a user in the database. |
reset_password()wp-includes/user.php | Handles resetting the user’s password. |
register_new_user()wp-includes/user.php | Handles registering a new user. |
clean_user_cache()wp-includes/user.php | Cleans all user caches. |
wp_insert_user()wp-includes/user.php | Inserts a user into the database. |
wp_signon()wp-includes/user.php | Authenticates and logs a user in with ‘remember’ capability. |
load_template()wp-includes/template.php | Requires the template file with WordPress environment. |
get_the_post_thumbnail()wp-includes/post-thumbnail-template.php | Retrieves the post thumbnail. |
clean_post_cache()wp-includes/post.php | Will clean the post in the cache. |
clean_attachment_cache()wp-includes/post.php | Will clean the attachment in the cache. |
_publish_post_hook()wp-includes/post.php | Hook to schedule pings and enclosures when a post is published. |
wp_delete_attachment()wp-includes/post.php | Trashes or deletes an attachment. |
wp_publish_post()wp-includes/post.php | Publishes a post by transitioning the post status. |
wp_transition_post_status()wp-includes/post.php | Fires actions related to the transitioning of a post’s status. |
wp_untrash_post_comments()wp-includes/post.php | Restores comments for a post from the Trash. |
wp_insert_post()wp-includes/post.php | Inserts or update a post. |
wp_delete_post()wp-includes/post.php | Trashes or deletes a post or page. |
wp_trash_post()wp-includes/post.php | Moves a post or page to the Trash |
wp_untrash_post()wp-includes/post.php | Restores a post from the Trash. |
wp_trash_post_comments()wp-includes/post.php | Moves comments for a post to the Trash. |
stick_post()wp-includes/post.php | Makes a post sticky. |
unstick_post()wp-includes/post.php | Un-sticks a post. |
register_post_type()wp-includes/post.php | Registers a post type. |
WP_Rewrite::set_permalink_structure()wp-includes/class-wp-rewrite.php | Sets the main permalink structure for the site. |
_wp_put_post_revision()wp-includes/revision.php | Inserts post data into the posts table as a post revision. |
wp_restore_post_revision()wp-includes/revision.php | Restores a post to the specified revision. |
wp_delete_post_revision()wp-includes/revision.php | Deletes a revision. |
add_existing_user_to_blog()wp-includes/ms-functions.php | Adds a user to a blog based on details from maybe_add_existing_user_to_blog() . |
wpmu_activate_signup()wp-includes/ms-functions.php | Activates a signup. |
wpmu_create_user()wp-includes/ms-functions.php | Creates a user. |
wpmu_signup_blog()wp-includes/ms-functions.php | Records site signup information for future activation. |
wpmu_signup_user()wp-includes/ms-functions.php | Records user signup information for future activation. |
add_user_to_blog()wp-includes/ms-functions.php | Adds a user to a blog, along with specifying the user’s role. |
remove_user_from_blog()wp-includes/ms-functions.php | Removes a user from a blog. |
switch_to_blog()wp-includes/ms-blogs.php | Switches the current blog. |
restore_current_blog()wp-includes/ms-blogs.php | Restores the current blog, after calling switch_to_blog() . |
clean_blog_cache()wp-includes/ms-site.php | Clean the blog cache |
wpmu_update_blogs_date()wp-includes/ms-blogs.php | Updates the last_updated field for the current site. |
wp_delete_nav_menu()wp-includes/nav-menu.php | Deletes a navigation menu. |
wp_update_nav_menu_object()wp-includes/nav-menu.php | Saves the properties of a menu or create a new menu with those properties. |
wp_update_nav_menu_item()wp-includes/nav-menu.php | Saves the properties of a menu item or create a new one. |
wp_xmlrpc_server::mt_getPostCategories()wp-includes/class-wp-xmlrpc-server.php | Retrieves post categories. |
wp_xmlrpc_server::mt_setPostCategories()wp-includes/class-wp-xmlrpc-server.php | Sets categories for a post. |
wp_xmlrpc_server::mt_supportedMethods()wp-includes/class-wp-xmlrpc-server.php | Retrieves an array of methods supported by this server. |
wp_xmlrpc_server::mt_supportedTextFilters()wp-includes/class-wp-xmlrpc-server.php | Retrieves an empty array because we don’t support per-post text filters. |
wp_xmlrpc_server::mt_getTrackbackPings()wp-includes/class-wp-xmlrpc-server.php | Retrieves trackbacks sent to a given post. |
wp_xmlrpc_server::mt_publishPost()wp-includes/class-wp-xmlrpc-server.php | Sets a post’s publish status to ‘publish’. |
wp_xmlrpc_server::pingback_ping()wp-includes/class-wp-xmlrpc-server.php | Retrieves a pingback and registers it. |
wp_xmlrpc_server::pingback_extensions_getPingbacks()wp-includes/class-wp-xmlrpc-server.php | Retrieves an array of URLs that pingbacked the given URL. |
wp_xmlrpc_server::mw_editPost()wp-includes/class-wp-xmlrpc-server.php | Edits a post. |
wp_xmlrpc_server::mw_getPost()wp-includes/class-wp-xmlrpc-server.php | Retrieves a post. |
wp_xmlrpc_server::mw_getRecentPosts()wp-includes/class-wp-xmlrpc-server.php | Retrieves list of recent posts. |
wp_xmlrpc_server::mw_getCategories()wp-includes/class-wp-xmlrpc-server.php | Retrieves the list of categories on a given blog. |
wp_xmlrpc_server::mw_newMediaObject()wp-includes/class-wp-xmlrpc-server.php | Uploads a file, following your settings. |
wp_xmlrpc_server::mt_getRecentPostTitles()wp-includes/class-wp-xmlrpc-server.php | Retrieves the post titles of recent posts. |
wp_xmlrpc_server::mt_getCategoryList()wp-includes/class-wp-xmlrpc-server.php | Retrieves the list of all categories on a blog. |
wp_xmlrpc_server::blogger_getUserInfo()wp-includes/class-wp-xmlrpc-server.php | Retrieves user’s data. |
wp_xmlrpc_server::blogger_getPost()wp-includes/class-wp-xmlrpc-server.php | Retrieves a post. |
wp_xmlrpc_server::blogger_getRecentPosts()wp-includes/class-wp-xmlrpc-server.php | Retrieves the list of recent posts. |
wp_xmlrpc_server::blogger_newPost()wp-includes/class-wp-xmlrpc-server.php | Creates a new post. |
wp_xmlrpc_server::blogger_editPost()wp-includes/class-wp-xmlrpc-server.php | Edits a post. |
wp_xmlrpc_server::blogger_deletePost()wp-includes/class-wp-xmlrpc-server.php | Deletes a post. |
wp_xmlrpc_server::mw_newPost()wp-includes/class-wp-xmlrpc-server.php | Creates a new post. |
wp_xmlrpc_server::wp_getMediaItem()wp-includes/class-wp-xmlrpc-server.php | Retrieves a media item by ID. |
wp_xmlrpc_server::wp_getPostFormats()wp-includes/class-wp-xmlrpc-server.php | Retrieves a list of post formats used by the site. |
wp_xmlrpc_server::wp_getPostType()wp-includes/class-wp-xmlrpc-server.php | Retrieves a post type. |
wp_xmlrpc_server::wp_getPostTypes()wp-includes/class-wp-xmlrpc-server.php | Retrieves post types. |
wp_xmlrpc_server::wp_getRevisions()wp-includes/class-wp-xmlrpc-server.php | Retrieves revisions for a specific post. |
wp_xmlrpc_server::wp_getMediaLibrary()wp-includes/class-wp-xmlrpc-server.php | Retrieves a collection of media library items (or attachments). |
wp_xmlrpc_server::wp_restoreRevision()wp-includes/class-wp-xmlrpc-server.php | Restores a post revision. |
wp_xmlrpc_server::blogger_getUsersBlogs()wp-includes/class-wp-xmlrpc-server.php | Retrieves blogs that user owns. |
wp_xmlrpc_server::wp_getComments()wp-includes/class-wp-xmlrpc-server.php | Retrieves comments. |
wp_xmlrpc_server::wp_deleteComment()wp-includes/class-wp-xmlrpc-server.php | Deletes a comment. |
wp_xmlrpc_server::wp_editComment()wp-includes/class-wp-xmlrpc-server.php | Edits a comment. |
wp_xmlrpc_server::wp_newComment()wp-includes/class-wp-xmlrpc-server.php | Creates a new comment. |
wp_xmlrpc_server::wp_getCommentStatusList()wp-includes/class-wp-xmlrpc-server.php | Retrieves all of the comment status. |
wp_xmlrpc_server::wp_getCommentCount()wp-includes/class-wp-xmlrpc-server.php | Retrieves comment counts. |
wp_xmlrpc_server::wp_getPostStatusList()wp-includes/class-wp-xmlrpc-server.php | Retrieves post statuses. |
wp_xmlrpc_server::wp_getPageStatusList()wp-includes/class-wp-xmlrpc-server.php | Retrieves page statuses. |
wp_xmlrpc_server::wp_getPages()wp-includes/class-wp-xmlrpc-server.php | Retrieves Pages. |
wp_xmlrpc_server::wp_newPage()wp-includes/class-wp-xmlrpc-server.php | Creates a new page. |
wp_xmlrpc_server::wp_deletePage()wp-includes/class-wp-xmlrpc-server.php | Deletes a page. |
wp_xmlrpc_server::wp_editPage()wp-includes/class-wp-xmlrpc-server.php | Edits a page. |
wp_xmlrpc_server::wp_getPageList()wp-includes/class-wp-xmlrpc-server.php | Retrieves page list. |
wp_xmlrpc_server::wp_getAuthors()wp-includes/class-wp-xmlrpc-server.php | Retrieves authors list. |
wp_xmlrpc_server::wp_getTags()wp-includes/class-wp-xmlrpc-server.php | Gets the list of all tags. |
wp_xmlrpc_server::wp_newCategory()wp-includes/class-wp-xmlrpc-server.php | Creates a new category. |
wp_xmlrpc_server::wp_deleteCategory()wp-includes/class-wp-xmlrpc-server.php | Deletes a category. |
wp_xmlrpc_server::wp_suggestCategories()wp-includes/class-wp-xmlrpc-server.php | Retrieves category list. |
wp_xmlrpc_server::wp_getComment()wp-includes/class-wp-xmlrpc-server.php | Retrieves a comment. |
wp_xmlrpc_server::wp_getPosts()wp-includes/class-wp-xmlrpc-server.php | Retrieves posts. |
wp_xmlrpc_server::wp_newTerm()wp-includes/class-wp-xmlrpc-server.php | Creates a new term. |
wp_xmlrpc_server::wp_editTerm()wp-includes/class-wp-xmlrpc-server.php | Edits a term. |
wp_xmlrpc_server::wp_deleteTerm()wp-includes/class-wp-xmlrpc-server.php | Deletes a term. |
wp_xmlrpc_server::wp_getTerm()wp-includes/class-wp-xmlrpc-server.php | Retrieves a term. |
wp_xmlrpc_server::wp_getTerms()wp-includes/class-wp-xmlrpc-server.php | Retrieves all terms for a taxonomy. |
wp_xmlrpc_server::wp_getTaxonomy()wp-includes/class-wp-xmlrpc-server.php | Retrieves a taxonomy. |
wp_xmlrpc_server::wp_getTaxonomies()wp-includes/class-wp-xmlrpc-server.php | Retrieves all taxonomies. |
wp_xmlrpc_server::wp_getUser()wp-includes/class-wp-xmlrpc-server.php | Retrieves a user. |
wp_xmlrpc_server::wp_getUsers()wp-includes/class-wp-xmlrpc-server.php | Retrieves users. |
wp_xmlrpc_server::wp_getProfile()wp-includes/class-wp-xmlrpc-server.php | Retrieves information about the requesting user. |
wp_xmlrpc_server::wp_editProfile()wp-includes/class-wp-xmlrpc-server.php | Edits user’s profile. |
wp_xmlrpc_server::wp_getPage()wp-includes/class-wp-xmlrpc-server.php | Retrieves a page. |
wp_xmlrpc_server::wp_newPost()wp-includes/class-wp-xmlrpc-server.php | Creates a new post for any registered post type. |
wp_xmlrpc_server::wp_editPost()wp-includes/class-wp-xmlrpc-server.php | Edits a post for any registered post type. |
wp_xmlrpc_server::wp_deletePost()wp-includes/class-wp-xmlrpc-server.php | Deletes a post for any registered post type. |
wp_xmlrpc_server::wp_getPost()wp-includes/class-wp-xmlrpc-server.php | Retrieves a post. |
wp_xmlrpc_server::wp_getUsersBlogs()wp-includes/class-wp-xmlrpc-server.php | Retrieves the blogs of the user. |
WP_Customize_Control::maybe_render()wp-includes/class-wp-customize-control.php | Check capabilities and render the control. |
dynamic_sidebar()wp-includes/widgets.php | Display dynamic sidebar. |
the_widget()wp-includes/widgets.php | Output an arbitrary widget as a template tag. |
register_sidebar()wp-includes/widgets.php | Builds the definition for a single sidebar and returns the ID. |
wp_register_sidebar_widget()wp-includes/widgets.php | Register an instance of a widget. |
wp_unregister_sidebar_widget()wp-includes/widgets.php | Remove widget from sidebar. |
comment_form()wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
WP_Customize_Widgets::wp_ajax_update_widget()wp-includes/class-wp-customize-widgets.php | Updates widget settings asynchronously. |
WP_Customize_Widgets::print_styles()wp-includes/class-wp-customize-widgets.php | Calls admin_print_styles-widgets.php and admin_print_styles hooks to allow custom styles from plugins. |
WP_Customize_Widgets::print_scripts()wp-includes/class-wp-customize-widgets.php | Calls admin_print_scripts-widgets.php and admin_print_scripts hooks to allow custom scripts from plugins. |
WP_Customize_Widgets::enqueue_scripts()wp-includes/class-wp-customize-widgets.php | Enqueues scripts and styles for Customizer panel and export data to JavaScript. |
WP_Customize_Widgets::print_footer_scripts()wp-includes/class-wp-customize-widgets.php | Calls admin_print_footer_scripts and admin_print_scripts hooks to allow custom scripts from plugins. |
WP_Customize_Widgets::customize_controls_init()wp-includes/class-wp-customize-widgets.php | Ensures all widgets get loaded into the Customizer. |
print_head_scripts()wp-includes/script-loader.php | Prints the script queue in the HTML head on admin pages. |
wp_print_head_scripts()wp-includes/script-loader.php | Prints the script queue in the HTML head on the front end. |
wp_print_footer_scripts()wp-includes/script-loader.php | Hooks to print the scripts and styles in the footer. |
wp_enqueue_scripts()wp-includes/script-loader.php | Wrapper for do_action( ‘wp_enqueue_scripts’ ). |
clean_comment_cache()wp-includes/comment.php | Removes a comment from the object cache. |
wp_set_comment_status()wp-includes/comment.php | Sets the status of a comment. |
wp_new_comment()wp-includes/comment.php | Adds a new comment to the database. |
wp_update_comment()wp-includes/comment.php | Updates an existing comment in the database. |
wp_update_comment_count_now()wp-includes/comment.php | Updates the comment count for the post. |
do_all_pings()wp-includes/comment.php | Performs all pingbacks, enclosures, trackbacks, and sends to pingback services. |
wp_spam_comment()wp-includes/comment.php | Marks a comment as Spam. |
wp_unspam_comment()wp-includes/comment.php | Removes a comment from the Spam. |
wp_insert_comment()wp-includes/comment.php | Inserts a comment into the database. |
wp_transition_comment_status()wp-includes/comment.php | Calls hooks for when a comment status transition occurs. |
wp_delete_comment()wp-includes/comment.php | Trashes or deletes a comment. |
wp_trash_comment()wp-includes/comment.php | Moves a comment to the Trash |
wp_untrash_comment()wp-includes/comment.php | Removes a comment from the Trash |
wp_allow_comment()wp-includes/comment.php | Validates whether this comment is allowed to be made. |
delete_metadata()wp-includes/meta.php | Deletes metadata for the specified object. |
update_metadata_by_mid()wp-includes/meta.php | Updates metadata by meta ID. |
delete_metadata_by_mid()wp-includes/meta.php | Deletes metadata by meta ID. |
add_metadata()wp-includes/meta.php | Adds metadata for the specified object. |
update_metadata()wp-includes/meta.php | Updates metadata for the specified object. If no value already exists for the specified object ID and metadata key, the metadata will be added. |
_WP_Editors::enqueue_scripts()wp-includes/class-wp-editor.php | |
_WP_Editors::editor_js()wp-includes/class-wp-editor.php | Print (output) the TinyMCE configuration and initialization scripts. |
WP_Error::add()wp-includes/class-wp-error.php | Adds an error or appends an additional message to an existing error. |
_WP_Editors::editor()wp-includes/class-wp-editor.php | Outputs the HTML for a single instance of the editor. |
wp_print_media_templates()wp-includes/media-template.php | Prints the templates used in the media manager. |
is_wp_error()wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
Example
Result:
BIG GOTCHA:
When calling
do_action
, if the$arg
you pass in is an array with a single object, it will instead pass that obejct in and NOT an array. It doesn’t do the same switcheroo, however, if the array’s single item is anything other than an arrayE.g.,
echoes out
notice that the first time we passed in an array with an
stdclass
in it, but the callback function only received thestdclass
, NOT an arrayRelated:
add_action()
remove_action()
do_action
allows you to create a custom action hook. Suppose I want to create custom hook calledmy_custom_hook
and want to work with it. So the codes will be something like this-