do_action( 'add_meta_boxes', string $post_type , WP_Post $post )
Fires after all built-in meta boxes have been added.
Parameters Parameters
- $post_type
-
(string) Post type.
- $post
-
(WP_Post) Post object.
More Information More Information
The hook allows meta box registration for any post type.
Passes two parameters: $post_type
and $post
.
Note: You can also use add_meta_boxes_{post_type}
for best practice, so your hook will only run when editing a specific post type. This will only receive 1 parameter – $post
.
Source Source
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
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.