wphooks.info - admin_init

admin_init

(trunk - 5.0-alpha-43304)

The hook occurs in the following 3 files

wp-admin/admin-post.php:
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
}

/** Allow for cross-domain requests (from the front end). */
send_origin_headers();

require_once( ABSPATH . 'wp-admin/includes/admin.php' );

nocache_headers();

/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );

$action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action'];

if ( ! wp_validate_auth_cookie() ) {
	if ( empty( $action ) ) {
		/**
		 * Fires on a non-authenticated admin post request where no action was supplied.
		 *
		 * @since 2.6.0
wp-admin/admin-ajax.php:
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/** Load Ajax Handlers for WordPress Core */
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );

@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
@header( 'X-Robots-Tag: noindex' );

send_nosniff_header();
nocache_headers();

/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );

$core_actions_get = array(
	'fetch-list',
	'ajax-tag-search',
	'wp-compression-test',
	'imgedit-preview',
	'oembed-cache',
	'autocomplete-user',
	'dashboard-widgets',
wp-admin/admin.php:
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/**
 * Fires as an admin screen or script is being initialized.
 *
 * Note, this does not just run on user-facing admin screens.
 * It runs on admin-ajax.php and admin-post.php as well.
 *
 * This is roughly analogous to the more general {@see 'init'} hook, which fires earlier.
 *
 * @since 2.5.0
 */
do_action( 'admin_init' );

if ( isset( $plugin_page ) ) {
	if ( ! empty( $typenow ) ) {
		$the_parent = $pagenow . '?post_type=' . $typenow;
	} else {
		$the_parent = $pagenow;
	}
	if ( ! $page_hook = get_plugin_page_hook( $plugin_page, $the_parent ) ) {
		$page_hook = get_plugin_page_hook( $plugin_page, $plugin_page );