Creating a Front-end based User Search

As you haven’t offered the details on what you’re after, I’ll try to grab them all very briefly. Use the API – public WP_User_Query API functions Basically get_user_by() should be enough for you. Let’s say you fire of your form and the input field name was user_id. So you’d just retrieve the value from the … Read more

get_users() ORDER BY Not Working

Try putting the args into an array. $args = array( ‘role’ => ‘subscriber’, ‘orderby’ => ‘ID’, ‘order’ => ‘DESC’, ‘fields’ => ‘all_with_meta’, ‘meta_query’ => $meta_query ); $my_users = get_users( $args );

WP_User->add_role producing unexpected results

This would be best as a comment, but no reputation 🙂 In the codex they say “If you are defining a custom role, and adding capabilities to the role using add_role(), be aware that modifying the capabilities array and re-executing add_role() will not necessarily update the role with the new capabilities list. The add_role() function … Read more

Is it possible to duplicate users on a new WordPress install?

Migrate DB Pro can help with this, make sure to migrate any plugin tables and the WP_Users and WP_Usermeta tables if your users make posts and you want that content to remain assigned an available make sure to keep WP_Posts and WP_Postmeta table as well. https://deliciousbrains.com/wp-migrate-db-pro/ Also keep in mind that WP uses an EAV … Read more

Drop down list in user profile page

thanks for that. Just one minor tweak, as the first bit of code threw up an error. Below is the working code for the first block of code. //hooks add_action( ‘show_user_profile’, ‘Add_user_fields’ ); add_action( ‘edit_user_profile’, ‘Add_user_fields’ ); function Add_user_fields( $user ) { ?> <h3>Extra fields</h3> <table class=”form-table”> <tr> <th><label for=”text”>text</label></th> <td> <?php // get test … Read more