Sorting editor screen items

The meta box order gets stored in the user meta and is basically an array of “priority” and meta box id.

I didn’t check if this meta key gets generated upon user setup or when the first manual reordering occurs.

To see how this array looks, and how the native WP metaboxes IDs on a page (post, cpt) are, you can var_dump the following:

var_dump(get_user_meta(1, 'meta-box-order_page', true));

The result should look like:

'side' => array
     (
          'submitdiv', // publish box
          'pageparentdiv', // page-attributes
          'postimagediv' // featured thumbnail
     ),

 'normal' => array
     (
          'postcustomdiv', // custom fields
          'commentstatusdiv', // comments open/closed
          'commentsdiv', // comments
          'slugdiv', // page slug
          'authordiv', // Author
          'revisionsdiv' // Revisons
     )

There may be more, I didn’t check this yet and am a bit tired 🙂

So you might want to check if this user meta key is already set ( if it’s not automatically generated ), and add it if not. Since you have your custom boxes, you have to use the IDs of the box as you use it by your add_meta_box function. Should work, but not tested.

At least, this should give you an idea where to start.