solepixel / bmoney-custom-metaboxes

Custom Metabox Plugin for WordPress
6 stars 1 forks source link

Conflict with Tribe Events #2

Open kyleevansio opened 10 years ago

kyleevansio commented 10 years ago

Yo B$,

I may have found a conflict with Modern Tribe's Events Calendar. I got the fatal error when updating the Events Calendar and Events Calendar Pro both to 3.2. The error:

Fatal error: Call to undefined function get_current_screen() in [..]/wp-content/plugins/the-events-calendar/lib/tribe-event-query.class.php on line 268

The problem goes away if I turn off this one specific field on a custom metabox I created. This select field tries to list all events using get_posts, using the argument 'post_type' => 'tribe_events' . If I change 'tribe_events' to another post type, like 'post', the error goes away. I've also tried using WP_Query and Tribe's tribe_get_events() and still receive the fatal error.

I'm not sure what the real problem is, but there seem to be similar ones out there, mostly with an e-commerce plugin. This one guy says it has something to do with how WP is loaded - https://github.com/stephenharris/Event-Organiser/issues/34 .

webportpl commented 9 years ago

change to this:

//$screen = ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ? null : get_current_screen(); $screen = '';

in this file: wp-content\plugins\the-events-calendar\lib\tribe-event-query.class.php