I want the main WordPress post editor to appear below some of my meta boxes (generated by Advanced Custom Fields).
I know there are the add_meta_box()
and remove_meta_box()
functions, however it’d be really awesome if I could just modify the editor meta box priority without having to remove and add it again.
Any ideas?
The editor is hard-coded into the form. It isn’t inserted by add_meta_box
.
There is a hook called edit_form_after_title
which you should be able to use though.
Proof of concept:
// use the action to create a place for your meta box
function add_before_editor($post) {
global $post;
do_meta_boxes('post', 'pre_editor', $post);
}
add_action('edit_form_after_title','add_before_editor');
// add a box the location just created
function test_box() {
add_meta_box(
'generic_box', // id, used as the html id att
__( 'Generic Title' ), // meta box title
'generic_cb', // callback function, spits out the content
'post', // post type or page. This adds to posts only
'pre_editor', // context, where on the screen
'low' // priority, where should this go in the context
);
}
function generic_cb($post) {
var_dump($post);
echo 'generic content';
}
add_action( 'add_meta_boxes', 'test_box' );