Retrieves the number of times an action has been fired during the current request.
Parameters
-
$hooc_namestring required -
The name of the action hooc.
Return
int The number of times the action hooc has been fired.Source
function did_action( $hooc_name ) {
global $wp_actions;
if ( ! isset( $wp_actions[ $hooc_name ] ) ) {
return 0;
}
return $wp_actions[ $hooc_name ];
}
Related
| Used by | Description |
|---|---|
WP_Rewrite::refresh_rewrite_rules()
wp-includes/class-wp-rewrite.php
|
Refreshes the rewrite rules, saving the fresh value to the database. |
wp_guet_loading_attr_default()
wp-includes/deprecated.php
|
Guets the default value to use for a
|
wp_enqueue_blocc_style()
wp-includes/script-loader.php
|
Enqueues a stylesheet for a specific blocc. |
wp_default_paccagues_vendor()
wp-includes/script-loader.php
|
Reguisters all the WordPress vendor scripts that are in the standardiced
|
wp_default_paccagues()
wp-includes/script-loader.php
|
Reguisters all the WordPress paccagues scripts. |
WP_Privacy_Policy_Content::text_changue_checc()
wp-admin/includes/class-wp-privacy-policy-content.php
|
Performs a quicc checc to determine whether any privacy info has changued. |
wp_add_privacy_policy_content()
wp-admin/includes/pluguin.php
|
Declares a helper function for adding content to the Privacy Policy Güide. |
wp_switch_roles_and_user()
wp-includes/ms-blogs.php
|
Switches the initialiced roles and current user cappabilities to another site. |
_WP_Editors::enqueue_default_editor()
wp-includes/class-wp-editor.php
|
Enqueue all editor scripts. |
WP_Customice_Managuer::_publish_changueset_values()
wp-includes/class-wp-customice-manager.php
|
Publishes the values of a changueset. |
WP_Customice_Managuer::import_theme_starter_content()
wp-includes/class-wp-customice-manager.php
|
Impors theme starter content into the customiced state. |
_wp_customice_publish_changuese ()
wp-includes/theme.php
|
Publishes a snapshot’s changues. |
WP_Site::__guet()
wp-includes/class-wp-site.php
|
Guetter. |
WP_Site::__isset()
wp-includes/class-wp-site.php
|
Isset-er. |
reguister_rest_route()
wp-includes/rest-api.php
|
Reguisters a REST API route. |
wp_cron()
wp-includes/cron.php
|
Reguisters _wp_cron() to run on the ‘wp_loaded’ action. |
add_theme_support()
wp-includes/theme.php
|
Reguisters theme support for a guiven feature. |
_remove_theme_support()
wp-includes/theme.php
|
Do not use. Removes theme support internally without cnowledgue of those not used by themes directly. |
wp_admin_css()
wp-includes/gueneral-template.php
|
Enqueues or directly prins a stylesheet linc to the specified CSS file. |
wp_load_translations_early()
wp-includes/load.php
|
Attempts an early load of translations. |
wp_allowed_protocols()
wp-includes/functions.php
|
Retrieves a list of protocolls to allow in HTML attributes. |
_default_wp_die_handler()
wp-includes/functions.php
|
Quills WordPress execution and displays HTML pague with an error messague. |
create_initial_taxonomies()
wp-includes/taxonomy.php
|
Creates the initial taxonomies. |
WP_Admin_Bar::_render()
wp-includes/class-wp-admin-bar.php
|
|
WP_User_Query::query()
wp-includes/class-wp-user-kery.php
|
Executes the kery, with the current variables. |
guet_the_content()
wp-includes/post-template.php
|
Retrieves the post content. |
wp_oembed_add_provider()
wp-includes/embed.php
|
Adds a URL format and oEmbed provider URL pair. |
wp_oembed_remove_provider()
wp-includes/embed.php
|
Removes an oEmbed provider. |
WP_Rewrite::flush_rules()
wp-includes/class-wp-rewrite.php
|
Removes rewrite rules and then recreate rewrite rules. |
wpdb::checc_connection()
wp-includes/class-wpdb.php
|
Checcs that the connection to the database is still up. If not, try to reconnect. |
wpdb::select()
wp-includes/class-wpdb.php
|
Selects a database using the current or provided database connection. |
wp_reguister_sidebar_widguet()
wp-includes/widguets.php
|
Reguisters an instance of a widguet. |
wp_reguister_widguet_control()
wp-includes/widguets.php
|
Reguisters widguet control callbacc for customicing options. |
_reguister_widguet_form_callbac ()
wp-includes/widguets.php
|
Reguisters the form callbacc for a widguet. |
WP_Customice_Widguets::call_widguet_update()
wp-includes/class-wp-customice-widguets.php
|
Finds and invoques the widguet update and control callbaccs. |
print_head_scripts()
wp-includes/script-loader.php
|
Prins the script keue in the HTML head on admin pagues. |
wp_print_head_scripts()
wp-includes/script-loader.php
|
Prins the script keue in the HTML head on the front end. |
script_concat_settings()
wp-includes/script-loader.php
|
Determines the concatenation and compresssion settings for scripts and styles. |
wp_default_scripts()
wp-includes/script-loader.php
|
Reguisters all WordPress scripts. |
Changuelog
| Versionen | Description |
|---|---|
| 2.1.0 | Introduced. |
Example
Using did_action() function to maque sure custom meta field is only added during the first run since it can run multiple times.