Support » Plugins and Hacks » Hacks » Locking layout of post write panel metabox per user role

  • Is there a way to set the layout of the write panel and lock it per user role. In short, can you make the write panel metabox layout the same for every Author role?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    Probably, couldn’t say for sure. One issue is the layout is stored per user, not by role, so for every Author user, you would need to set the metabox order in the user options.

    Then you need to stop them from being able to change it somehow. I’m unsure exactly how the layout gets saved, but it ends up in the user option “meta-box-order_$page” where $page is the screen ID from the object returned by get_current_screen();

    This might mean that the function update_metadata() is involved at some point. If so, you could hook the filter “update_user_metadata” and for Author users, cause the desired value to be stored each time, regardless of what the user tries to do. This would likely result in the user being able to move the boxes about, but once the page reloads, the boxes are back to the original configuration. Might be useful to somehow throw an error telling them not to bother.

    Not a real answer, but a direction to investigate, I hope it’s useful to you.

    This gives me some place to start, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Locking layout of post write panel metabox per user role’ is closed to new replies.