SHARE
TWEET

change order of bookings

eventsmanager Jul 30th, 2018 129 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. Changes the order of bookings lists by latest date first, such as in the 'my bookings' page and bookings admin tables.
  4.  
  5. For instructions on adding snippets, see here - http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  6. */
  7. function my_em_change_bookings_list_order( $args ){
  8.     $args['orderby'] = 'booking_date';
  9.     $args['order'] = 'DESC';
  10.     return $args;
  11. }
  12. add_filter('em_bookings_get_default_search', 'my_em_change_bookings_list_order', 10);
  13. //from EM 5.9.7 onwards change filter to em_bookings_table_get_bookings_args and this will only apply to bookings table
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top