Fires after all built-in meta boxes have been added.
Parameters
$post_type
string- Post type.
$post
WP_Post- Post object.
Source
do_action( 'add_meta_boxes', $post_type, $post );
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
Fires after all built-in meta boxes have been added.
$post_type
string$post
WP_Postdo_action( 'add_meta_boxes', $post_type, $post );
Version | Description |
---|---|
3.0.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
this note is to provide feedback for the documentation
the following code will produce an error in PHP >= 7
PHP Fatal Error: Uncaught Type Error: Argument #2 ($post) must be of type WP_Post, WP_Comment given
if I try to edit a comment navigating to
/wp-admin/comment.php?action=editcomment&c=COMMENT_ID
it seems that the hook is fired with objects of type WP_Comment as well
Example migrated from Codex:
Example usage:
Example with a post-type specific call:
Both will accomplish the same thing. Best practice is to use
add_meta_boxes_{post-type}
to create less unnecessary hooks for other post types.