This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Order user search results by mu.startdate

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

#22454
Ernest MarcinkoErnest Marcinko
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;
}