Action hook 'add_meta_boxes'

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

View Source

add_meta_boxes

Action Hook
Description
Fires after all built-in meta boxes have been added.

Hook Information

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

Hook Parameters

Type Name Description
string $post_type Post type.
WP_Post $post Post object.

Usage Examples

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

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

Source Code Context

wp-admin/includes/meta-boxes.php:1716 - How this hook is used in WordPress core
<?php
1711  	 * @since 3.0.0
1712  	 *
1713  	 * @param string  $post_type Post type.
1714  	 * @param WP_Post $post      Post object.
1715  	 */
1716  	do_action( 'add_meta_boxes', $post_type, $post );
1717  
1718  	/**
1719  	 * Fires after all built-in meta boxes have been added, contextually for the given post type.
1720  	 *
1721  	 * The dynamic portion of the hook name, `$post_type`, refers to the post type of the post.

PHP Documentation

<?php
/**
	 * Fires after all built-in meta boxes have been added.
	 *
	 * @since 3.0.0
	 *
	 * @param string  $post_type Post type.
	 * @param WP_Post $post      Post object.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-admin/includes/meta-boxes.php
Related Hooks

Related hooks will be displayed here in future updates.