Hi,
This might be a difficult one as I don’t fully understand the situation so will explain as best I can.
I have had incompatibility issues with the Woocommerce Memberships (https://www.woothemes.com/products/woocommerce-memberships/) plugin where it was crashing every time I edited a GD post type:
PHP Catchable fatal error: Argument 1 passed to WC_Memberships_Meta_Box_Post_Memberships_Data::output() must be an instance of WP_Post, instance of stdClass given, called in /wp-content/plugins/woocommerce-memberships/includes/admin/meta-boxes/abstract-wc-memberships-meta-box.php on line 222 and defined in /wp-content/plugins/woocommerce-memberships/includes/admin/meta-boxes/class-wc-memberships-meta-box-post-memberships-data.php on line 70
My workaround was to query to post type and if it started ‘GD_’ then return false and ignore the plugin code.
I’ve contacted the WooCommerce Memberships developers who have come back with the following.
It looks like the Geodirectory plugin is overriding the global $post object which is not the right way to do things. You might want to let them know that because it could cause other issues with your site.
I’m attaching a pre-release version of Memberships with a slightly different fix than what you suggested, it checks if the $post object is a WP_Post as Memberships requires and doesn’t add the meta box if it isn’t.
I don’t know the ‘correct’ way to do it but thought I’d share this to hopefully avoid potential incompatibilities with other plugins.