wps_store_get_store_admin breaks metaboxes
-
Hi,
A customer of ours is using your plugin and a plugin of ours, where we inject a metabox on the order edit screen (non-HPOS). The add_meta_box() callback function receives an object of type $post, which is supposed to be the post of that order.
Whenever your plugin is activated, and the wps_store_get_store_admin() function is called on wps-functions.php, function wps_stores_fields(), line 357, for some reason that we still haven’t been able to reproduce, the $post object that gets into our metabox is a Store and not the Order post, which means that (again, for some reason we haven’t been able to reproduce), the wp_reset_postdata() function is not doing what it should and the runtime global $post is replaced.
If we comment the query on that function, the problem goes away.
- The topic ‘wps_store_get_store_admin breaks metaboxes’ is closed to new replies.