Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm having a small issue with the custom post type entry screen. I'd like to bump up my metabox right under the content box, but I'm not sure if that's even possible (as the metaboxes in between are "defaults", i.e.; Excerpt, Discussion & Author).

I'm applying the standard code:

function ctp_admin(){
add_meta_box('cpt_meta', 'Meta Box', 'cpt_meta', 'cpt_function', 'normal', 'high');
}

Thank you!

Noel

share|improve this question
    
Can't you just drag and drop that section? –  moettinger Jan 10 '11 at 18:01
    
It's about the initial placement. For an efficient custom workflow you don't want users to faff about reordering boxes. Most regular users don't even realise they can be reordered. –  sanchothefat Jan 10 '11 at 18:23
    
Like Sancho said, not from an initial/automatic point of view. Thank you though! –  Noel Tock Jan 10 '11 at 19:48
    
Can you add the hook you are calling the ctp_admin function on to your question? –  sanchothefat Jan 11 '11 at 11:09
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
    
Thank you for that Sancho, I've added it but have had no change so far. I haven't tampered with manually repositioning it, so it shouldn't be affecting it from that angle. I'll still reset the positions within the db and give it another try. –  Noel Tock Jan 10 '11 at 19:46
    
Ah wait sorry - I think I'm wrong. Can you update your question with the hook you're running your function on? I think using 'normal' context should work if your function is called on the 'add_meta_boxes' action. I'll update my answer if that's the case. –  sanchothefat Jan 10 '11 at 20:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.