{"id":1121577,"date":"2016-06-02T06:24:57","date_gmt":"2016-06-02T13:24:57","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/"},"modified":"2016-06-02T06:24:57","modified_gmt":"2016-06-02T13:24:57","slug":"tribe_events-post-type-being-added-to-custom-get_posts-query","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/","title":{"rendered":"tribe_events post type being added to custom get_posts query"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I have the following query that is being run in a pre_get_posts action. <\/p>\n<pre><code>$args = array(\n\t&#039;post_type&#039;\t\t\t=&gt; &#039;portfolio&#039;,\n\t&#039;fields&#039;\t\t\t=&gt; &#039;ids&#039;,\n\t&#039;posts_per_page&#039;\t=&gt; -1,\n\t&#039;tag__in&#039;\t\t\t=&gt; [13]\n);\n\n$portfolios\t= get_posts($args);<\/code><\/pre>\n<p>Examining the resulting query with <a href=\"https:\/\/wordpress.org\/plugins\/query-monitor\/\">query monitor<\/a> reveals that the post type &#8216;tribe_events&#8217; is being added to the query.<\/p>\n<pre><code>SELECT wp_posts.ID\nFROM wp_posts \nINNER JOIN wp_term_relationships\nON (wp_posts.ID = wp_term_relationships.object_id)\nWHERE 1=1 \nAND ( wp_term_relationships.term_taxonomy_id IN (13) )\nAND wp_posts.post_type IN (&#039;portfolio&#039;, &#039;tribe_events&#039;)\nAND ((wp_posts.post_status = &#039;publish&#039;))\nGROUP BY wp_posts.ID\nORDER BY wp_posts.post_date DESC<\/code><\/pre>\n<p>If I remove the <code>tag__in<\/code> line the query works as expected, but with that line the &#8216;tribe_events&#8217; post type shows up. If I disable The Events Calendar plugin the query works as expected with tag__in.  I&#8217;ve also deactivated all plugins except the plugin running my query and the events calendar as well as switched to the default 2016 theme. <\/p>\n","protected":false},"template":"","class_list":["post-1121577","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>tribe_events post type being added to custom get_posts query -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"tribe_events post type being added to custom get_posts query -\" \/>\n<meta property=\"og:description\" content=\"Hello, I have the following query that is being run in a pre_get_posts action. $args = array( &#039;post_type&#039; =&gt; &#039;portfolio&#039;, &#039;fields&#039; =&gt; &#039;ids&#039;, &#039;posts_per_page&#039; =&gt; -1, &#039;tag__in&#039; =&gt; [13] ); $portfolios = get_posts($args); Examining the resulting query with query monitor reveals that the post type &#8216;tribe_events&#8217; is being added to the query. SELECT wp_posts.ID FROM [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/\",\"name\":\"tribe_events post type being added to custom get_posts query -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-06-02T13:24:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"tribe_events post type being added to custom get_posts query\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"tribe_events post type being added to custom get_posts query -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/","og_locale":"en_US","og_type":"article","og_title":"tribe_events post type being added to custom get_posts query -","og_description":"Hello, I have the following query that is being run in a pre_get_posts action. $args = array( &#039;post_type&#039; =&gt; &#039;portfolio&#039;, &#039;fields&#039; =&gt; &#039;ids&#039;, &#039;posts_per_page&#039; =&gt; -1, &#039;tag__in&#039; =&gt; [13] ); $portfolios = get_posts($args); Examining the resulting query with query monitor reveals that the post type &#8216;tribe_events&#8217; is being added to the query. SELECT wp_posts.ID FROM [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/","name":"tribe_events post type being added to custom get_posts query -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-06-02T13:24:57+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events-post-type-being-added-to-custom-get_posts-query\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"tribe_events post type being added to custom get_posts query"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1121577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1121577\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1121577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}