mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 06:03:38 +09:00
- fixed member directory roles query;
This commit is contained in:
@@ -1047,10 +1047,14 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
*
|
||||
*/
|
||||
function hide_by_role() {
|
||||
if ( ! is_user_logged_in() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$roles = um_user( 'can_view_roles' );
|
||||
$roles = maybe_unserialize( $roles );
|
||||
|
||||
if ( empty( $roles ) || ! UM()->roles()->um_user_can( 'can_view_all' ) ) {
|
||||
if ( UM()->roles()->um_user_can( 'can_view_all' ) && empty( $roles ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2429,6 +2433,16 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
unset( $this->query_args['meta_query'] );
|
||||
}
|
||||
|
||||
if ( isset( $this->query_args['role__in'] ) && empty( $this->query_args['role__in'] ) ) {
|
||||
$member_directory_response = apply_filters( 'um_ajax_get_members_response', array(
|
||||
'pagination' => $this->calculate_pagination( $directory_data, 0 ),
|
||||
'users' => array(),
|
||||
'is_search' => $this->is_search,
|
||||
), $directory_data );
|
||||
|
||||
wp_send_json_success( $member_directory_response );
|
||||
}
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user