The function wp_dropdown_users() seems to break my site.
-
I’m trying to restrict the users in the post editor’s “authors” dropdown to users with the custom role of “welder”.
But the wp_dropdown_users() function seems to break my site (the post editor never loads). When I remove the function, everything goes back to behaving normally.
function ls_authors_dropdown($output) { $welders = get_users( array( 'role' => 'welder', 'fields' => 'ID' )); $args = array( 'include' => $welders, ); $output = wp_dropdown_users($args); return $output; } add_filter( 'wp_dropdown_users', 'ls_authors_dropdown');
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘The function wp_dropdown_users() seems to break my site.’ is closed to new replies.