Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active December 14, 2016 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/3ad962e282219f922021ebf55d6d79e2 to your computer and use it in GitHub Desktop.
Save joshfeck/3ad962e282219f922021ebf55d6d79e2 to your computer and use it in GitHub Desktop.
Change the order of the events in the admin list table so they're ordered by Datetime, in descending order. https://eventespresso.com/topic/event-list-not-sorting-by-date/
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action ( 'admin_menu', 'ee_filter_ee_events_orderyby_datetime', 99 );
function ee_filter_ee_events_orderyby_datetime() {
// call global submenu item
global $submenu;
// edit main link for events
$submenu['espresso_events'][0][2] = 'admin.php?page=espresso_events&orderby=Datetime.DTT_EVT_start&order=asc&active_status=upcoming';
}

Usage notes

You can add the code to a functions plugin or into your WordPress theme's functions.php file.

You can change order=asc to order=desc to reverse the order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment