Action hook 'do_meta_boxes'

in WP Core File wp-admin/includes/meta-boxes.php at line 1752

View Source

do_meta_boxes

Action Hook
Description
Fires after meta boxes have been added. Fires once for each of the default meta box contexts: normal, advanced, and side.

Hook Information

File Location wp-admin/includes/meta-boxes.php View on GitHub
Hook Type Action
Line Number 1752

Hook Parameters

Type Name Description
string $post_type Post type of the post on Edit Post screen, 'link' on Edit Link screen, 'dashboard' on Dashboard screen.
string $context Meta box context. Possible values include 'normal', 'advanced', 'side'.
WP_Post|object|string $post Post object on Edit Post screen, link object on Edit Link screen, an empty string on Dashboard screen.

Usage Examples

Basic Usage
<?php
// Hook into do_meta_boxes
add_action('do_meta_boxes', 'my_custom_function', 10, 3);

function my_custom_function($post_type, $context, $post) {
    // Your custom code here
}

Source Code Context

wp-admin/includes/meta-boxes.php:1752 - How this hook is used in WordPress core
<?php
1747  	 */
1748  	do_action( 'do_meta_boxes', $post_type, 'normal', $post );
1749  	/** This action is documented in wp-admin/includes/meta-boxes.php */
1750  	do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
1751  	/** This action is documented in wp-admin/includes/meta-boxes.php */
1752  	do_action( 'do_meta_boxes', $post_type, 'side', $post );
1753  }

PHP Documentation

<?php
/**
	 * Fires after meta boxes have been added.
	 *
	 * Fires once for each of the default meta box contexts: normal, advanced, and side.
	 *
	 * @since 3.0.0
	 *
	 * @param string                $post_type Post type of the post on Edit Post screen, 'link' on Edit Link screen,
	 *                                         'dashboard' on Dashboard screen.
	 * @param string                $context   Meta box context. Possible values include 'normal', 'advanced', 'side'.
	 * @param WP_Post|object|string $post      Post object on Edit Post screen, link object on Edit Link screen,
	 *                                         an empty string on Dashboard screen.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-admin/includes/meta-boxes.php
Related Hooks

Related hooks will be displayed here in future updates.