I guess you can do with get_users, something like:
$topusers = get_users( array (
'meta_key' => 'todayuserclicks',
'meta_value' => '',
'meta_compare' => '!=',
'orderby' => 'meta_value',
'order' => 'DESC',
'number' => '10',
) );
Related Posts:
- LEFT JOIN, INNER OUTER JOIN, LEFT OUTER JOIN is driving me crazy. Please help?
- Search multiple meta keys at once
- Querying Email Addresses for a List of Users with Same Last Name?
- In what part of the WordPress core does the users table and usermeta table get joined?
- Modify Database in Multi-Site wp_usermeta table
- Get an array of meta_values for a user meta_key
- mysql query two database tables, users and usermeta and sort by custom meta int value
- WordPress SQL Issue not returning correct reselts
- get_results not returning anything
- Get emails from users by custom field SQL
- How to relate the Category to user?
- How to get image path from id using SQL
- Intermittent problem writing update_user_meta
- Checking if meta_value exists for any user
- $wpdb->get_row() only returns a single row?
- wpdb->insert: do I need to prepare against SQL injection?
- user_login vs. user_nicename
- How to programatically change username (user_login)?
- Adding fields to the “Add New User” screen in the dashboard
- How to parse row results from $wpdb -> get_results
- Difference between update_user_meta and update_user_option
- Why $wpdb->show_errors() and print_error() is showing an output even if the query output is correct?
- what is the way to see the currently executing query in wordpress?
- Fetch array with $wpdb
- How to filter users on admin users page by custom meta field?
- How do I check for a duplicate record before inserting using wpdb
- get_user_meta() doesn’t include user email?
- WordPress 4.8.1 uses mysql_connect which doesn’t work with PHP 7
- How to use $wpdb to delete in a custom table
- $wpdb->insert not working in any way
- WPDB prepare – like % – placeholders?
- Automatically delete inactive users after 2 months
- Check if user is admin by user ID
- $wpdb->update multiple rows, like IN in normal SQL
- Matching database content types to PHP types
- Does $wpdb->prepare not create a prepared statement that I can execute multiple times?
- Return all users with a specific meta key
- get_results on large datasets
- $wpdb->insert() and Values for Datetime Columns?
- Where the Nickname is being used in WordPress
- $wpdb->last_error doesn’t show the query on error
- How to display custom user meta from registration in backend?
- Allowing an email as the username?
- Grouping users under parent user
- get_users is expecting unserialized meta_value
- How to get users by a custom field / by user meta data?
- Avoiding “Usage of a direct database call is discouraged”
- How to create a template for a custom URI associated with the user
- How to order users alphabetically by their last name?
- Getting all user metadata from user
- dbDelta does not create Table, but returns success
- Theoretical Multi-Server WordPress Setup with Shared Users
- How do you add a custom option to user data?
- Extending WP_User class and using this sub-class during the whole lifecycle
- Change post status based on meta value
- Wp_User_Query not sorting by meta key
- Add a button to users.php
- wpdb->insert not working
- How we can get the user id by its display_name
- WP_User_Query with combined meta query – not working?
- How to use hyperdb to separate and share a user dataset between wordpress installs?
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- Show Biographical Info while creating new user
- Saving custom form data into database
- include user profiles in search results?
- How to add follow functionality to multi-author wordpress site?
- How may I filter get_users() similarly to pre_get_posts?
- passing variables as parameters to stored procedures via wpdb from php-script
- Where to Store Custom User Fields
- Get data from database table by post_id to get data from second database table
- wp-content/db.php : where is this file?
- Plugin that would allow WordPress Authors to “follow” other Authors and query “Activity Info” from that
- Getting users who registered 360 days from current date
- Display sortable User meta column in admin panel user’s page
- Show User Their Password
- User profile custom field
- Showing user ID on user main page from screen options
- Quotes in table name
- Front end user meta options for users
- Delete/replace img tags in post content for auto published posts [closed]
- $wpdb sql help. Select post id and post meta value based on 2 other post_meta values
- $wpdb->get_results() returns good result only in first foreach iteration
- $wpdb->insert – inserting multiple rows
- ACF Upload Image in front-end with custom form
- Speed optimization of $wpdb->get_results
- How do I create a single.php for a specific category?
- $wpdb prepared with search term
- Extra User Profile Field Upload File / Image
- WPDB->insert with special characters
- How can I sort get_users() by any value (last_name, user defined fields and more)
- delete_user_meta Delete one value out of array
- What does wp_update_post() do that the $wpdb class does not?
- How Can I Use $wpdb in PayPal IPN file?
- $wpdb is get_results escaped
- How to add quick edit and bulk edit fields to users admin section
- $wpdb->query() multiple query support
- wpdb-> not adding prefix to custom table
- Is there a (better) way to access $wpdb results?
- Using $wpdb generates DB error
- WordPress insert NOW() in TIMESTAMP column returns all zeros