eventsmanager

change order of bookings

Jul 30th, 2018
285
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×