I have a custom meta box for a custom post type that my client wants placed between the title/permalink section and the post editor in the admin panel. Is this possible and if so is there a hook/filter/etc that I would need to use?
Leave a Reply
You must be logged in to post a comment.
edit_form_after_title
hookPrint your meta boxes out there, then remove it so it doesn’t appear twice.
Here is how you can move specific meta boxes above the editor, but before I post the code I just would like to thank Andrew and mhulse. You guys rock!
To provide a full code example based on Andrew’s answer … I needed a way to include a “Deck” (aka subhead) to my posts; I wanted the deck field to appear after the main title bar.
Obviously, the code above could use some more work, but it should help others trying to do the same stuff (Andrew’s answer shined light, but I thought it might be helpful to actually provide a working example).
This answer also helped.
Improvements that could be made:
I plan on making the above improvements at some point in future, but at least the above code should help others trying to figure this out.
See source code here for more inspiration (they opted to use jQuery to move the “sub-title”).
Instead of moving everything in the advanced section to the top, why not create a new section and move that to the top:
Now all you need to do is register the meta box using
top
for the section andhigh
for the priority.It’s working on WordPress 4.4.2 for me. I haven’t tested this on other WP versions.
There is an other way, by the way we can put the editor to any position:
Remove editor from support param when you register post_type
add a fake metabox