mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 13:43:38 +09:00
Fix search username query
This commit is contained in:
@@ -16,12 +16,14 @@
|
||||
extract( $args );
|
||||
|
||||
$query = $ultimatemember->permalinks->get_query_array();
|
||||
|
||||
|
||||
foreach( $ultimatemember->members->core_search_fields as $key ) {
|
||||
if ( isset( $query[$key] ) ) {
|
||||
|
||||
if ( isset( $query[$key] ) && ! empty( $query[$key] ) ) {
|
||||
$query_args['search'] = '*' . trim($query[$key]) . '*';
|
||||
}
|
||||
}
|
||||
|
||||
return $query_args;
|
||||
}
|
||||
|
||||
@@ -109,7 +111,6 @@
|
||||
if ( count ($query_args['meta_query']) == 1 ) {
|
||||
unset( $query_args['meta_query'] );
|
||||
}
|
||||
|
||||
return $query_args;
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ class UM_Members {
|
||||
if ( is_admin() ) {
|
||||
$search_columns[] = 'display_name';
|
||||
} else {
|
||||
$search_columns = array('display_name','user_email');
|
||||
$search_columns = array('display_name','user_email','user_login');
|
||||
}
|
||||
return $search_columns;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ class UM_Members {
|
||||
$query_args = array();
|
||||
$query_args = apply_filters( 'um_prepare_user_query_args', $query_args, $args );
|
||||
$users = new WP_User_Query( $query_args );
|
||||
|
||||
|
||||
// number of profiles for mobile
|
||||
if ( $ultimatemember->mobile->isMobile() && isset( $profiles_per_page_mobile ) )
|
||||
$profiles_per_page = $profiles_per_page_mobile;
|
||||
|
||||
Reference in New Issue
Block a user