I’ve had an issue where other plugins that hook into the meta_boxes report an error, namely that a null value is passed instead of a string, in core/admin/templates/admin_details_wrapper.template.php on line 7.
(Specifically, the plugin SearchWP reported this for me, and that broke the page because of the error.)
For now I’ve simply added a null check to that line so that everything works again, but EE isn’t supposed to be able to pass null there.
Kindly let me know if you’ve fixed this in an update.
Whilst I do agree that $post_type (and $post) being null on those pages doesn’t help and I’ve created a ticket for us to investigate this further (HERE).
I’m not sure why SearchWP needs a type declaration here, as far as I can tell it doesn’t solve anything and simply throws a fatal just because of the type mismatch. As in if you remove the type declaration from SearchWP’s function it works in exactly the same way. Checks if $post is an instance of WP_Post and if $post_type is equal to ‘attachment’ and if not, returns.
The only thing that $post_type would be used for is to check for a specific type, seems to odd to add a type declaration for this as if it isn’t what you are looking for then move along and carry on rather throw an exception.
Or, better yet, switch to add_meta_boxes_{$post_type} and only add a metabox when on the correct post type but I digress.
Whilst we investigate this I’ve created a snippet that removes SearchWP from the EE admin pages to prevent this, see:
Note that whilst I’m using SearchWP as an example here, this could be any plugin on that hook.
The support post ‘Null passed as post_type to add_meta_boxes in core/admin/templates/admin_details’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.