Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 6035

Refers to accounts with the ability to login and participate in a WordPress site.

12 votes
Accepted

Check if specific username is logged in

wp_get_current_user then compare the object that's returned user_login proprety with the specific username you'd like to check against. <?php add_action('admin_init', 'wpse74389_check_username'); fun …
chrisguitarguy's user avatar
7 votes
Accepted

How to detect first visit of a user?

No, there's nothing in the core like that. You can set a cookie and do it simply enough (warning: untested code follows). <?php function is_first_time() { if (isset($_COOKIE['_wp_first_time']) | …
chrisguitarguy's user avatar
7 votes
Accepted

How to get the user description with get_users?

[user_status] => 0 [display_name] => Richard Branson as you can see user_description is not a part of this object since it's stored in a different table in the database(usermeta as oppose to users
chrisguitarguy's user avatar
12 votes
Accepted

Return all users with a specific meta key

php $users = get_users(array( 'meta_key' => 'your_meta_key', )); Alternatively, you can use an empty string for meta_value (the default) and > for meta_compare. … php $users = get_users(array( 'meta_key' => 'your_meta_key', 'meta_value' => '', 'meta_compare' => '>', )); The first method works when using WP_Query and meta_query as well. …
chrisguitarguy's user avatar
2 votes

Keep Logged in Users out of Admin Panel

current_user_can( 'read' ) ) { wp_redirect( home_url(), 302 ); exit(); } } You'll also probably want to remove the admin bar for users with a read capability. …
chrisguitarguy's user avatar
2 votes

Average Account Age

WordPress records when a user was registered in the $wpdb->users (usually wp_users) table in the column user_registered. So you can use that to calculate the average account age. … If you, say, want to exclude all administrator level users, you'll have to fetch users via get_users of that role then exclude the array of those ID's (eg NOT IN). …
chrisguitarguy's user avatar
1 vote
Accepted

Select From wpdb - Author/User Directory page

php // get all users, regardless of roll. … php $users = get_users(array('fields' => 'all_with_meta')); foreach ($users as $user) { // $user will be a WP_User object. } Is there a way to only select users with specific author meta fields …
chrisguitarguy's user avatar
2 votes
Accepted

Customizing Users in Admin Area

How can I add them to the middle? You won't be able to add them directly where you want, but you can get close. There are four hooks to put stuff into the profile page: personal_options -- fir …
chrisguitarguy's user avatar