Home › Forums › Calendar Products › Events Calendar PRO › event_tribes post type taking over WP_Query
- This topic has 5 replies, 2 voices, and was last updated 12 years, 6 months ago by
Barry.
-
AuthorPosts
-
October 16, 2013 at 11:37 am #71321
nateritter
ParticipantI created my own short codes using these two files:
http://pastebin.com/xP463B73
http://pastebin.com/B0QffmcwThey are pretty simple additions of shortcodes. The problem is that when I have the Events Calendar plugin enabled, it takes over my WP_Query on line 28 of http://pastebin.com/B0Qffmcw . Here’s the output of the $connect_groups_query variable if I turn on Events Calendar v3.1 (not even turning on PRO yet): http://pastebin.com/aib6VXHF
Notice line 9 – the query_vars post_type is ‘post’ and ‘tribe_events’. Turning off the Events Calendar plugin results in what it should be … shown here: http://pastebin.com/2RReRce1 … notice line 6 where the query_vars post_type is ‘base_connect_groups’.
Why does the Events Plugin overwrite my query when it’s clearly a new WP_Query instantiation? Is this a bug?
October 16, 2013 at 2:34 pm #71380Barry
MemberIt shouldn’t, is the short answer 🙂
Is it possible that in the context of where you are using those shortcodes an event or event-related query has already run? Have you also investigated if any other plugins/your theme/other custom code might in turn be impacting here?
October 16, 2013 at 5:29 pm #71410nateritter
ParticipantI tested with all other plugins disabled and the 2011 theme.
October 17, 2013 at 11:10 am #71500Barry
MemberAn obvious difficulty in trying to replicate is that I don’t have either your data or this particular custom post type that you are using – nor do I know the complete context (ie, where are you actually deploying these shortcodes?).
However, if I set something like this up it returns the expected results and – if I inspect the WP_Query object (in my example) – it has not been taken over in any way. This is true whether I use the shortcode in a regular page or even if I embed it in an event description and view that single event.
It could definitely be I’m misunderstanding some aspect of what you’ve done in your own code and my own test is failing to replicate it, if so definitely let me know: should there be a bug here we’ll be happy to investigate further. Right now though I’m not sure exactly why or how the problem you are describing would come about.
October 17, 2013 at 12:17 pm #71513nateritter
ParticipantHmm.. ok. I’ll try to simplify the shortcode-generating code to see if perhaps it’s somewhere in there that’s the issue, but it’s strange that it doesn’t have a problem with any other plugin whatsoever. I’ll keep looking through my code I guess.
October 17, 2013 at 4:02 pm #71563Barry
MemberIt is strange – and we’re totally open to the idea of there being a problem on our side, but we’d need a better sense of how to recreate it 🙂
-
AuthorPosts
- The topic ‘event_tribes post type taking over WP_Query’ is closed to new replies.
