Apps+ export csv sorted by user column

In appointments+ Export. I want to have exported csv sorted automatically by the 'user' column.

  • Katya Tsihotska

    Hi Granite

    Hope you're having a great day!

    Since this is dealing with more advanced coding topics, I'm going to ping our SLS Team (code experts) to get their valuable feedback on this question. One of our SLS members will reply back here as soon as more information is available.

    Please keep in mind that our SLS Team deals with more complicated issues, thus it may take a little longer for them to reply here. Thank you for your patience while we look into this further.

    Kind regards,
    Katya

  • Panos

    Hi Granite ,

    I don't see any available hook for this, so it's not possible without modifying a plugin's file. Since in that file I will simply add a filter it is very likely to be included in future release, but I can't guarantee.

    So I have attached file :
    wp-content/plugins/appointments/includes/class-app-ajax.php

    This should be adding a new filter which we can use for changing the order. First you need to replace that file with the one attached. I would recommend to rename existing file to class-app-ajax.php.txt so you can keep it as a backup.

    Once you have replaced file, you can add the following code in a mu-plugin:

    add_filter( 'app-export-appointment-args', function( $args ){
    
    	$args['orderby'] = 'name';
    	$args['order'] = 'ASC';	
    
    	return $args;
    
    }, 10 );

    that should order the appointments in csv by name.

    Hope this helps!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.