[Resolved] Author dropdown only shows users with admin role
This support ticket is created 2 years, 4 months ago. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I am trying to:
I am trying to change author for People custom post type. After using the multiple roles per user feature to add additional roles per user, I can only change the post author to the user who created the post or other users assigned administrator role.
Link to a page where the issue can be seen:
link removed
I expected to see:
I expected to see a list of all users in author dropdown list.
Instead, I got:
Instead, I got only the list of users in author dropdown list who have administrator privileges.
To recreate the issue, please log in, visit People custom post type. Select any user and attempt to change author.
I checked my functions.php to ensure the code snippet from the previous fix was still installed:
add_filter('wp_dropdown_users_args', 'assign_any_users_author_box_func', 10, 2);
function assign_any_users_author_box_func($query_args, $r){
$query_arg['who'] = 'any';
return $query_arg;
}
Hello. Thank you for contacting the Toolset support.
Could you please try to use the following code instead of what you are using currently:
function func_author_dropdown_user_args( $query_args ) {
// Use this array to specify multiple roles to show in dropdown
$query_args['role__in'] = array('contributor','author', 'subscriber', 'administrator' );
// Unset the 'who' as this defaults to the 'author' role
unset( $query_args['who'] );
return $query_args;
}
add_filter( 'wp_dropdown_users_args', 'func_author_dropdown_user_args' );
Where:
- You can add any role name slug to the "role__in" argument.
Further testing shows that when I change the People custom post type from "Managed by Access" to "Use the default WordPress read permissions" the author dropdown list populates as it should, with all active users.
Can you please tell me where you added the code I shared. Also, it seems as you using WP Engine there is cache issue can you disable the cache until we address this issue.
Also I check the author dropdown showing number of users now, Can you please check if its working as expected.