change order of bookings

Jul 30th, 2018
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.
  5. For instructions on adding snippets, see here -
  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 from fully loading.

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

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