From 9b1c2c04d54d42377c6ff692e45dead9ec9c4e60 Mon Sep 17 00:00:00 2001 From: Armanul46 <47377178+Armanul46@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:47:50 +0600 Subject: [PATCH] fix select rule issue in all author page (#1823) --- includes/model/All_Authors.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/includes/model/All_Authors.php b/includes/model/All_Authors.php index adef82fd9b..f3129e2834 100644 --- a/includes/model/All_Authors.php +++ b/includes/model/All_Authors.php @@ -87,8 +87,17 @@ public function author_list( $type = '' ) { $args['orderby'] = 'display_name'; - if( 'all' != $all_authors_select_role ) { - $args['role__in'] = array( $all_authors_select_role ); + if ( 'author' == $all_authors_select_role ) { + $meta_query = array( + array( + 'key' => '_user_type', + 'value' => 'author', + 'compare' => '=' + ) + ); + $args['meta_query'] = $meta_query; + } elseif ( 'all' != $all_authors_select_role ) { + $args['role__in'] = array( $all_authors_select_role ); } if( ! empty( $_REQUEST['alphabet'] ) && 'ALL' != $_REQUEST['alphabet'] ) {