-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metaboxes added on the admin_head
hook are not added to the post edit page
#3165
Comments
This is definitely fixable. I had code that solved it but I believe I chopped it out on a rebase. Thank you for the report! |
@BE-Webdesign Would this by chance require adding a third iframe? |
For your use case yes, but for the topic of this issue, no. If I understand the issue topic correctly, meta boxes are not being registered correctly as plugins who register on |
Based on my performance tests in #3304 (comment), it would be ill-advised to add yet another iframe if that means enqueuing a fourth set of plugin assets on the page. I understand that may "fix" the original issue, but I don't think it benefits us to knowingly commit solutions that don't belong in the final product based on the performance concerns and additional limitations of iframes. |
Is this issue still relevant? |
This is still relevant in some cases. I am carving out time to work on Meta Boxes this weekend. |
@aduth this issue is not reproducible for me anymore. The test metabox I gave on the issue description is properly displayed everywhere. @BE-Webdesign what are those cases you are referring to? Clearly out of curiosity. |
Closing, but feel free to reopen. |
When registering a metabox to be added in the
admin_head
hook, the metabox doesn't appear on thePost edit
page as it does for thePage edit
page.For the case of the
Page edit
page, thegutenberg_meta_box_partial_page_admin_header
method is called which does again theadmin_head
action. I think we need something similar for thePost edit
page too.The strange thing is that when creating a new post, the metaboxes are there. After debugging this a bit, I saw that when creating a new post, the
global $post
post type isrevision
, the revision of the currently edited post, while when creating a post the post type from theglobal $post
ispost
. Based on this behavior, for thePost edit
page, the metabox is registered for therevision
post type, while for theNew Post
page, the metabox is registered for thepost
post type.Test code:
The text was updated successfully, but these errors were encountered: