wp_user_query with meta_value_num for leaderboard
wp_user_query with meta_value_num for leaderboard
wp_user_query with meta_value_num for leaderboard
Making a user platform reachable by a qr code on a pin-back-button [closed]
You could use multiple meta clauses in your WP_User_Query, along with a LIKE comparison. Something like $args = array( ‘role’ => ‘member’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘specializations’, ‘value’ => ‘doctor’, ‘compare’ => ‘LIKE’, ), array( ‘key’ => ‘specializations’, ‘value’ => ‘researcher’, ‘compare’ => ‘LIKE’, ), ), ); $found_users = new … Read more
It’s possible that there’s an issue with your SMTP configuration or with the mailing queue. You can try using a debugging plugin, such as WP Mail Logging, to help diagnose the issue. This plugin logs all emails sent through WordPress and displays them in the admin dashboard, allowing you to see if the emails are … Read more
Try using: ‘orderby’=>’distribution_list last_name’, ‘order’=>’ASC’ Instead of: ‘orderby’ => array( ‘distribution_list’ => ‘ASC’, ‘last_name’ => ‘ASC’, ), So: $users = new WP_User_Query( array( ‘meta_query’ => array( ‘relation’ => ‘AND’, ‘lastname’ => array( ‘key’ => ‘last_name’, ‘compare’ => ‘EXISTS’, ‘type’ => ‘CHAR’, ), ‘list’ => array( ‘distribution_list’ => array( ‘key’ => ‘distribution_list’, ‘value’ => ‘”72″‘, ‘compare’ … Read more
WordPress WP_User_Query ignores the `meta_query` when called from an Ajax function
The user password (stored as an MD5 hash) can be retrieved like so: $users = get_users(); foreach ( $users as $user ) { $password = $user->user_pass; } Assuming you have some known value for passkey, you can hash it and compare it to each user’s password: $passkey = ‘somestring’; $hashed_passkey = md5( $passkey ); $users … Read more
Show only users with the same role in Dashboard user list
You can do this more simply by using the pre_get_users hook, grab the search string extract the role from it and add that as a role parameter for WP_User_Query. Edited my original code, here’s a refined version, bit cleaner. Additional edit: Scroll further down for update (see follow-up). class wpse_410251_user_search { private $role = false; … Read more
This isn’t possible, you can’t safely/reliably query the internals of meta value strings that way, and you can’t use it as a form of indirection: You can query for substrings or for whole values, but you can’t query the internals of serialised PHP values without major performance reliability and consistency issues but if you could, … Read more