WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
событие не описано

init хук-событие . WP 1.5.0

Fires after WordPress has finished loading but before any headers are sent.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

Most of WP is loaded at this stage, and the user is authenticated. WP continues to load on the init hook that follows (e.g. widgets), and many plugins instantiate themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).

If you wish to plug an action once WP is loaded, use the wp_loaded hook below.

Использование

add_action( 'init', 'action_function_name_2805' );
function action_function_name_2805(){
	// action...
}

Список изменений

С версии 1.5.0 Введена.

Где вызывается хук

В файле: /wp-settings.php
init
wp-settings.php 578
do_action( 'init' );

Где используется хук в ядре WordPress

wp-includes/blocks/archives.php 119
add_action( 'init', 'register_block_core_archives' );
wp-includes/blocks/block.php 61
add_action( 'init', 'register_block_core_block' );
wp-includes/blocks/calendar.php 61
add_action( 'init', 'register_block_core_calendar' );
wp-includes/blocks/categories.php 97
add_action( 'init', 'register_block_core_categories' );
wp-includes/blocks/file.php 36
add_action( 'init', 'register_block_core_file' );
wp-includes/blocks/index.php 87
add_action( 'init', 'register_core_block_types_from_metadata' );
wp-includes/blocks/latest-comments.php 157
add_action( 'init', 'register_block_core_latest_comments' );
wp-includes/blocks/latest-posts.php 206
add_action( 'init', 'register_block_core_latest_posts' );
wp-includes/blocks/legacy-widget.php 79
add_action( 'init', 'register_block_core_legacy_widget' );
wp-includes/blocks/loginout.php 51
add_action( 'init', 'register_block_core_loginout' );
wp-includes/blocks/page-list.php 227
add_action( 'init', 'register_block_core_page_list' );
wp-includes/blocks/post-content.php 72
add_action( 'init', 'register_block_core_post_content' );
wp-includes/blocks/post-date.php 48
add_action( 'init', 'register_block_core_post_date' );
wp-includes/blocks/post-excerpt.php 63
add_action( 'init', 'register_block_core_post_excerpt' );
wp-includes/blocks/post-featured-image.php 47
add_action( 'init', 'register_block_core_post_featured_image' );
wp-includes/blocks/post-template.php 88
add_action( 'init', 'register_block_core_post_template' );
wp-includes/blocks/post-terms.php 64
add_action( 'init', 'register_block_core_post_terms' );
wp-includes/blocks/post-title.php 55
add_action( 'init', 'register_block_core_post_title' );
wp-includes/blocks/query-pagination-next.php 67
add_action( 'init', 'register_block_core_query_pagination_next' );
wp-includes/blocks/query-pagination-numbers.php 79
add_action( 'init', 'register_block_core_query_pagination_numbers' );
wp-includes/blocks/query-pagination-previous.php 56
add_action( 'init', 'register_block_core_query_pagination_previous' );
wp-includes/blocks/query-pagination.php 16
add_action( 'init', 'register_block_core_query_pagination' );
wp-includes/blocks/query-title.php 49
add_action( 'init', 'register_block_core_query_title' );
wp-includes/blocks/query.php 16
add_action( 'init', 'register_block_core_query' );
wp-includes/blocks/rss.php 106
add_action( 'init', 'register_block_core_rss' );
wp-includes/blocks/search.php 117
add_action( 'init', 'register_block_core_search' );
wp-includes/blocks/shortcode.php 31
add_action( 'init', 'register_block_core_shortcode' );
wp-includes/blocks/site-logo.php 95
add_action( 'init', 'register_block_core_site_logo' );
wp-includes/blocks/site-tagline.php 41
add_action( 'init', 'register_block_core_site_tagline' );
wp-includes/blocks/site-title.php 50
add_action( 'init', 'register_block_core_site_title' );
wp-includes/blocks/social-link.php 62
add_action( 'init', 'register_block_core_social_link' );
wp-includes/blocks/tag-cloud.php 54
add_action( 'init', 'register_block_core_tag_cloud' );
wp-includes/class-wp-customize-manager.php 370
remove_action( 'init', 'wp_cron' );
wp-includes/class.wp-scripts.php 143
add_action( 'init', array( $this, 'init' ), 0 );
wp-includes/default-filters.php 448
add_action( 'init', '_show_post_preview' );
wp-includes/default-filters.php 606
add_action( 'init', 'wp_widgets_init', 1 );
wp-includes/default-filters.php 585
add_action( 'init', 'create_initial_taxonomies', 0 ); // Highest priority.
wp-includes/default-filters.php 548
add_action( 'init', 'kses_init' );
wp-includes/default-filters.php 534
add_action( 'init', 'create_initial_post_types', 0 ); // Highest priority.
wp-includes/default-filters.php 509
add_action( 'init', 'wp_sitemaps_get_server' );
wp-includes/default-filters.php 502
add_action( 'init', 'rest_api_init' );
wp-includes/default-filters.php 372
add_action( 'init', 'wp_schedule_https_detection' );
wp-includes/default-filters.php 418
add_action( 'init', 'wp_schedule_delete_old_privacy_export_files' );
wp-includes/default-filters.php 398
add_action( 'init', 'smilies_init', 5 );
wp-includes/default-filters.php 368
add_action( 'init', 'wp_cron' );
wp-includes/default-filters.php 337
add_action( 'init', array( 'WP_Block_Supports', 'init' ), 22 );
wp-includes/default-filters.php 336
add_action( 'init', 'check_theme_switched', 99 );
wp-includes/default-filters.php 334
add_action( 'init', '_register_core_block_patterns_and_categories' );
wp-includes/default-filters.php 131
add_action( 'init', 'wp_init_targeted_link_rel_filters' );
wp-includes/ms-default-filters.php 16
add_action( 'init', 'ms_subdomain_constants' );
wp-includes/ms-default-filters.php 25
add_action( 'init', 'maybe_add_existing_user_to_blog' );
wp-includes/update.php 982
add_action( 'init', 'wp_schedule_update_checks' );