Can I force a metabox to be in one column?

If you want the meta box to appear below the content area, use the context parameter ‘normal’. See Function Reference/add meta box – Parameters. Initially, your meta box should only go to the side bar if the context parameter is set to ‘side’.

As far as making it impossible for the user to drag it to the side, study the answer at “Block metabox – No expanding, no moving around” for some direction on this.

  1. Write a function to add a custom class to the postbox element which is handled by postbox.js.
  2. The answer linked to above provides a script that disables the ability to both move and sort any meta box which uses your custom class.

Since you wish to make your meta box sortable while restricting it to the column beneath the content area, see if you can discover which part of
postbox.js
determines whether a postbox is set beneath the content or on the
side bar. It seems that you want it to appear in #poststuff and not in #side-sortables. I don’t have a script to do this at the moment, but hopefully this set you in the right direction.

Leave a Comment