mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- added sorting by last & first name;
This commit is contained in:
@@ -245,6 +245,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
'first_name' => __( 'First name', 'ultimate-member' ),
|
||||
'last_name' => __( 'Last name', 'ultimate-member' ),
|
||||
'display_name' => __( 'Display name', 'ultimate-member' ),
|
||||
'last_first_name' => __( 'Last & First name', 'ultimate-member' ),
|
||||
'last_login' => __( 'Last login', 'ultimate-member' ),
|
||||
|
||||
) );
|
||||
@@ -1152,6 +1153,22 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
);
|
||||
unset( $this->query_args['order'] );
|
||||
|
||||
} elseif ( $sortby == 'last_first_name' ) {
|
||||
|
||||
$this->query_args['meta_query'][] = array(
|
||||
'last_name_c' => array(
|
||||
'key' => 'last_name',
|
||||
'compare' => 'EXISTS',
|
||||
),
|
||||
'first_name_c' => array(
|
||||
'key' => 'first_name',
|
||||
'compare' => 'EXISTS',
|
||||
),
|
||||
);
|
||||
|
||||
$this->query_args['orderby'] = array( 'last_name_c' => 'ASC', 'first_name_c' => 'ASC' );
|
||||
unset( $this->query_args['order'] );
|
||||
|
||||
} else {
|
||||
|
||||
if ( strstr( $sortby, '_desc' ) ) {
|
||||
|
||||
@@ -144,6 +144,12 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
* To learn more about version 2.1 please see this [topic](https://wordpress.org/support/topic/version-2-1-4/)
|
||||
* UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
|
||||
|
||||
= 2.1.3: December xx, 2019 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
- Added sorting by Last & First name
|
||||
|
||||
= 2.1.2: December 4, 2019 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
Plugin Name: Ultimate Member
|
||||
Plugin URI: http://ultimatemember.com/
|
||||
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
|
||||
Version: 2.1.2
|
||||
Version: 2.1.3-beta1
|
||||
Author: Ultimate Member
|
||||
Author URI: http://ultimatemember.com/
|
||||
Text Domain: ultimate-member
|
||||
|
||||
Reference in New Issue
Block a user