Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Order user search results by mu.startdate › Reply To: Order user search results by mu.startdate
May 3, 2019 at 7:52 am
#22454
Keymaster
Hi,
Well, while I cannot test, this might work if you have the latest release of the plugin installed (use in functions.php in theme directory):
add_filter('asp_query_args', 'asp_query_args_user_fields', 10, 1);
function asp_query_args_user_fields($args) {
global $wpdb;
$args['user_query'] = array(
'fields' => 'UNIX_TIMESTAMP(mu.startdate) as startdate, ',
'join' => " LEFT JOIN $wpdb->pmpro_memberships_users mu ON $wpdb->users.ID = mu.user_id ",
'where' => '',
'orderby' => ' startdate DESC, ',
'groupby' => ''
);
return $args;
}