Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix select rule issue in all author page #1823

Merged
merged 23 commits into from
Aug 29, 2024
13 changes: 11 additions & 2 deletions includes/model/All_Authors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) {
Expand Down