- changed status to resolved
Add a filter to change teh ordering of the exported appointments
Issue #721
resolved
By default, they are ordered by appointment ID and it would be more useful if it would be the DateTime instead. Having a filter so that anyone could decide what they want would be the best.
Requested here.
Comments (3)
-
-
reporter Not working for ordering. At least not with these snippets:
add_filter('woocommerce_appointment_export_data_args', function($args){ $args['orderby'] = array('Start timestamp' => 'DESC'); return $args; },1,99);
add_filter('woocommerce_appointment_export_data_args', function($args){ $args['orderby'] = array('start' => 'DESC'); return $args; },1,99);
-
After 4.9.11, the following code snippet can be used for this:
add_filter( 'woocommerce_appointment_export_data_args', 'modify_appointment_export_data_args', 10, 2 ); function modify_appointment_export_data_args( $args, $exporter ) { $args['order_by'] = 'start_date'; $args['order'] = 'DESC'; return $args; }
- Log in to comment
Introducing 'woocommerce_appointment_export_data_args' with 4.9.10