WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the Posts 2 Posts plugin specifically, but I think this applies to any meta box. I have three Posts 2 Posts metaboxes on the side: "Related Case Studies", "Related White Papers" and "Related Videos". I'd like the client to be able to drag these, and have the metabox order correspond to the order they appear on my sidebar. I can do all the backend code to sort properly on the page, I just need to retrieve the value of the metabox order on a per page basis.

Meaning if the client dragged the "Related Videos" metabox above the "Related Case Studies" metabox, I'd be able to grab a value to be aware of that on the page itself and output it exactly like it looks.

Is this possible?


share|improve this question
up vote 2 down vote accepted

It's not that hard: There's a user Meta entry for that.

You can not only retrieve the order, but also which ones are hidden (just to get one step further).

# Meta Box Order
$meta_box_order = get_user_meta( 
    ,sprintf( 'meta-box-order_%s', get_post_type() )

# Hidden Meta Box
$meta_box_hidden = get_user_meta( 
    ,sprintf( 'metaboxhidden_%s', get_post_type() )
share|improve this answer
Works perfectly. Thanks! – LOLapalooza Oct 23 '12 at 15:37

Your Answer


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.