Modifying the main editor priority

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' );

Leave a Comment