Navigation überspringen

[Gelöst] Cannot list custom role user in author dropdown

This support ticket is created vor 2 Jahren. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 2 Jahren.

Assistiert von: Minesh.

Author
Artikel
#2588195
Screenshot 2023-04-06 at 8.47.29 PM.png
Screenshot 2023-04-06 at 8.43.54 PM.png

Dear Sir/Madam,

I have a custom user role 'Applicant', I want to list out all applicant in the author dropdown from the application custom post.

I add below code but I can only see the original author and administrator in list

function wpdocs_add_members_to_dropdown( $query_args, $r ) {
 
    $query_args['role__in'] = array( 'applicant', 'administrator' );
    unset( $query_args['who'] );
 
    return $query_args;
}
add_filter( 'wp_dropdown_users_args', 'wpdocs_add_members_to_dropdown', 10, 2 );

Please advise how I can list all other applicant user in list.

#2588751

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I'm not sure why its not working with your site.

What if you try to follow the following blog post and try to adjust your desired role name and then check if that help you to resolve your issue.
- versteckter Link