{"id":1034621,"date":"2015-12-03T06:45:57","date_gmt":"2015-12-03T14:45:57","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/"},"modified":"2016-02-18T08:32:08","modified_gmt":"2016-02-18T16:32:08","slug":"what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/","title":{"rendered":"What do I replace deprecated Tribe__Events__Query with in this function snippet?"},"content":{"rendered":"<p>Trying this again from Firefox. I kept getting logged out in Safari. Version 4 seems to have deprecated every Tribe__Events__ in the code. I&#8217;d like to find out what to use in my function before I install Version 4.<\/p>\n<p>I noticed that one of the changes for Version 4 is &#8220;Deprecated &#8211; Removed some methods that have been deprecated since version 3.6 and earlier: tribe_events_single_event_meta, Tribe__Events__View_Helpers::[getMonthOptions, getDayOptions, getYearOptions], Tribe__Events__Query::posts_groupby, Tribe__Events__Main::[getRealStartDate, weekToDate, previousWeek]&#8221;<\/p>\n<p>What am I supposed to change Tribe__Events__Query with in the following function snippet I got from Geof? (See tickets https:\/\/theeventscalendar.com\/support\/forums\/topic\/all-instances-of-recurring-events-are-showing-on-the-home-page-above-recent-news\/ and<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"51owshl7iX\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/posts-are-getting-posted-in-the-wrong-order\/\">Posts are getting posted in the wrong order.<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Posts are getting posted in the wrong order.&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/posts-are-getting-posted-in-the-wrong-order\/embed\/#?secret=Ss6xikhJHf#?secret=51owshl7iX\" data-secret=\"51owshl7iX\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>Here is the function:<\/p>\n<pre><code>\n&lt;?php \n\/\/\n\/\/ *************************************\n\/\/ Events Calendar fix\n\/\/ Sort Events posts by creation \/ published date rather than start date\n\/\/ from Geoff&#039;s second code in ticket at\n\/\/ https:\/\/theeventscalendar.com\/support\/forums\/topic\/posts-are-getting-posted-in-the-wrong-order\/\n\/\/ NOTE: The &quot;Recurring events instances&quot; setting must be unchecked in the settings for this to work. Otherwise,\n\/\/ the two top functions just reorders future events at the top--with all the recent news posts below the future \n\/\/ events.\n\/\/ Not sure if the third function is really needed now because when the &quot;Recurring events instances&quot; was checked \n\/\/ on, that code just gave a list of all post categories starting with April 2007. When the box is unchecked, I get\n\/\/ what I want--all posts ordered by the date published--intermixing event posts with news posts.\n\/\/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\/\/\n\nadd_action( &#039;pre_get_posts&#039;, &#039;tribe_post_date_ordering&#039;, 51 );\n\nfunction tribe_post_date_ordering( $query ) {\nif ( $query-&gt;tribe_is_multi_posttype) {\nremove_filter( &#039;posts_fields&#039;, array( &#039;Tribe__Events__Query&#039;, &#039;multi_type_posts_fields&#039; ) ); $query-&gt;set( &#039;order&#039;, &#039;DESC&#039; );\n}\n}\n\nadd_action( &#039;pre_get_posts&#039;, &#039;custom_teardown_tribe_order_filter&#039;, 60 );\n\nfunction custom_teardown_tribe_order_filter() {\nif ( is_feed() ) remove_filter( &#039;posts_orderby&#039;, array( &#039;Tribe__Events__Query&#039;, &#039;posts_orderby&#039; ), 10, 2 );\n}\n\nadd_action( &#039;pre_get_posts&#039;, &#039;order_by_modified&#039; );\n\nfunction order_by_modified( $query ) {\n         \n  if ( $query-&gt;is_home() &amp;&amp; $query-&gt;is_main_query() ) {\n                         \n   $query-&gt;set( &#039;orderby&#039;, &#039;modified&#039; );\n  }\n}\n?&gt;\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1034621","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>What do I replace deprecated Tribe__Events__Query with in this function snippet? -<\/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\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What do I replace deprecated Tribe__Events__Query with in this function snippet? -\" \/>\n<meta property=\"og:description\" content=\"Trying this again from Firefox. I kept getting logged out in Safari. Version 4 seems to have deprecated every Tribe__Events__ in the code. I&#8217;d like to find out what to use in my function before I install Version 4. I noticed that one of the changes for Version 4 is &#8220;Deprecated &#8211; Removed some methods [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-02-18T16:32:08+00:00\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/\",\"name\":\"What do I replace deprecated Tribe__Events__Query with in this function snippet? -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-12-03T14:45:57+00:00\",\"dateModified\":\"2016-02-18T16:32:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/#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\":\"What do I replace deprecated Tribe__Events__Query with in this function snippet?\"}]},{\"@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":"What do I replace deprecated Tribe__Events__Query with in this function snippet? -","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\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/","og_locale":"en_US","og_type":"article","og_title":"What do I replace deprecated Tribe__Events__Query with in this function snippet? -","og_description":"Trying this again from Firefox. I kept getting logged out in Safari. Version 4 seems to have deprecated every Tribe__Events__ in the code. I&#8217;d like to find out what to use in my function before I install Version 4. I noticed that one of the changes for Version 4 is &#8220;Deprecated &#8211; Removed some methods [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/","article_modified_time":"2016-02-18T16:32:08+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/","name":"What do I replace deprecated Tribe__Events__Query with in this function snippet? -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-12-03T14:45:57+00:00","dateModified":"2016-02-18T16:32:08+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-do-i-replace-deprecated-tribe__events__query-with-in-this-function-snippet\/#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":"What do I replace deprecated Tribe__Events__Query with in this function snippet?"}]},{"@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\/1034621","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1034621\/revisions"}],"predecessor-version":[{"id":1035020,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1034621\/revisions\/1035020"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1034621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}