Created
January 7, 2016 16:24
-
-
Save geoffgraham/39d59bf67175e9b93bda to your computer and use it in GitHub Desktop.
The Events Calendar 4.0.4 // Reverse Chronological Order for List View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Changes listed event views to reverse chronological order | |
function tribe_past_reverse_chronological ($post_object) { | |
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'upcoming') ? true : false; | |
if(tribe_is_past() || tribe_is_upcoming() || $past_ajax) { | |
$post_object = array_reverse($post_object); | |
} | |
return $post_object; | |
} | |
add_filter('the_posts', 'tribe_past_reverse_chronological', 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment