Priority of Meta Box for Custom Post Type

Where you have the parameter ‘normal’ eg. the context parameter change that to read ‘core’.

add_meta_box('cpt_meta', 'Meta Box', 'cpt_meta', 'cpt_function', 'core', 'high');

The default meta boxes are registered as core and are listed first, followed by the ‘normal’ context. The docs don’t actually say you can do it but I have done without any problems.

EDIT:
Make sure your function is registered on the ‘add_meta_boxes’ hook with a high priority eg:

function my_metabox() {
    ...
}
add_action( 'add_meta_boxes', 'my_metabox', 1 ); // priority 1

The use of ‘core’ vs. ‘normal’ may not actually make a difference in the latest version.

Leave a Comment