admin_init

admin_init

Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.0.1

do_action('admin_init') is found 3 times:

  • /wp-admin/admin-ajax.php line 45
    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',
    
  • /wp-admin/admin-post.php line 30
     
    nocache_headers();
    
    /** This action is documented in wp-admin/admin.php */
    do_action( 'admin_init' );
    
    $action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
    
    // Reject invalid parameters.
    if ( ! is_scalar( $action ) ) {
    	wp_die( '', 400 );
    
  • /wp-admin/admin.php line 175
     * 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;
    

See this hook used in plugins:

Examples using admin_init