Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Show all user_role to the change author dropdown option **/
- //https://wordpress.org/support/topic/author-dropdown-fails-to-show-users-with-custom-role-that-includes-author-editor/
- //https://developer.wordpress.org/reference/hooks/wp_dropdown_users_args/
- add_action('wp_dropdown_users_args', 'filter_authors');
- function filter_authors( $args ) {
- if ( isset( $args['who'])) {
- $args['role__in'] = ['subscriber', 'author', 'editor', 'administrator', 'manager']; //add desires user role
- unset( $args['who']);
- }
- return $args;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement