Support » Fixing WordPress » Change postbox default order

  • I have a custom post type that was created for a theme I am building. Everything was fine until I added a plugin (The WordPress SEO by Yoast) But then the Plugin box was positioned above the Custom Post box. See Screenshot for reference.
    http://cl.ly/image/0j2i113e1W29

    Of course I could just re-order the boxes by dragging them. But this site will have 22 users all of different skill levels.

    I could well imagine one of the user filling out the fields in the plugin instead of the custom post type causing some confusion.

    I also know from a previous website using the Simple Map Plugin that they were able to order the postbox order to make sure there custom post type was at the top of the page and the plugin was at the bottom of the page. See Screenshot for reference. http://cl.ly/image/0D163D2T2o2M

    So my question is how can we dictate the default order of the postbox order for all users in a custom post type?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Your images show two different cases there.

    In the first one, you have two meta boxes on the left side, the Yoast thingy, and a box labelled “Personal Information”, which I assume is a custom meta box you added?

    In the second one, the thing on top is not a “meta box”, it’s the post form, which always resides on top. The Simple Map plugin is then a meta box, as is the Yoast thingy.

    So, one would need to know how you’re calling the add_meta_box() function.

    The add_meta_box function takes a lot of arguments. One of those is the priority value. Yoast’s SEO plugin is adding his as “high”. So it will be above anything else that isn’t “high” as well. You will need to set yours to be “high” priority as well, basically.

    Oddly enough, examining Yoast’s code, I think he has a bug because he’s adding the meta box twice for some reason, and only in one case is the priority ran through a filter to be changeable. You can see the code here (search for add_meta_box). You may want to report that to the plugin author.

    http://plugins.svn.wordpress.org/wordpress-seo/trunk/admin/class-metabox.php

    Thread Starter Robert Dall

    (@rdall)

    Hi Otto

    Thanks a lot for you help. I have reached out to Yoast regarding this bug. I did check my custom post type and did see it’s priority value already set to high.

    So this is really just a problem with the plugin then my custom post type.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change postbox default order’ is closed to new replies.