wp_dropdown_users with the arg include is not working
-
Hi,
I have been trying to create a dropdown with only few selected user IDs.
This is the method I have been using// Will provide the list of userIds which we need to show $users = $this->get_users_to_display_in_custom_dropdown(); wp_dropdown_users( array( 'include' => $users, 'selected' => ($_POST['user'] ? : get_current_user_id()), 'include_selected' => true, 'show' => 'user_login', ) );
But the above is showing all the users in the dropdown instead of the ones that is provided to the argument include.
Is there anything I need to add to show specific users only??
For a temporary fix I am generating the html manually similar to what wp_dropdown_users will give. The dropdown gets generated but stuck in saving the selected user value for the post.
Any help will be appreciated. Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_dropdown_users with the arg include is not working’ is closed to new replies.