Adding a photo to each WP user

I use a plugin called Avatar Manager for that function. The author has also done a tutorial on how to write your own avatar manager plugin, but unfortunately it is also a bit outdated and doesn’t work anymore. Although the plugin states it is compatible up to 3.6.1, it is still working in 3.8.1. I … Read more

determining if the user is logged in

Use the is_user_logged_in() conditional tag (Codex ref) to determine if the current user is logged in. Use the get_userdata() function (Codex ref) to return user data.

Querying Email Addresses for a List of Users with Same Last Name?

Hi @Holidaymaine: Here’s the query you are looking for: <?php include( ‘../wp-load.php’ ); $sql =<<<SQL SELECT DISTINCT u.user_email AS user_email, um.meta_value AS user_lastname FROM {$wpdb->users} AS u LEFT JOIN {$wpdb->usermeta} AS um ON u.ID = um.user_id LEFT JOIN {$wpdb->posts} AS p ON u.ID = p.post_author LEFT JOIN {$wpdb->term_relationships} AS tr ON p.ID = tr.object_id LEFT … Read more

How to use tinyMCE for user “biographical info” without messing with any core file?

Not sure if this is the perfect way to do it, but it worked for me by removing the description element using jQuery and then adding editor for the description element. /******************************************* * TinyMCE EDITOR “Biographical Info” USER PROFILE *******************************************/ function biographical_info_tinymce() { if ( basename($_SERVER[‘PHP_SELF’]) == ‘profile.php’ || basename($_SERVER[‘PHP_SELF’]) == ‘user-edit.php’ && function_exists(‘wp_tiny_mce’) ) … Read more

Getting users who registered 360 days from current date

I peeked into the WP_User_Query class and it supports a WP_Date_Query query on the user registration date. So we could use: $query = new WP_User_Query( $args ); or simply: $users = get_users( $args ); where: $args = [ ‘fields’ => ‘ID’, ‘number’ => 8, ‘date_query’ => [ [ ‘before’ => ‘359 days ago midnight’ ], … Read more

Get user input from a form

Use wp-admin/admin-post.php as form action handler, and bind your custom function as callback to that. A simple example for email updates. We will use a shortcode named [userform] here, but you can use a template too. add_shortcode( ‘userform’, ‘wpse_75723_userform’ ); add_action( ‘admin_post_update_user_email’, ‘wpse_75723_update’ ); /** * Create the form. */ function wpse_75723_userform() { $here = … Read more

Migrating users from .com to .org?

I don’t know if you can see the email addresss of your users in wordpress.com blog as i never used it. If you can, as you have not too many users you may try to add them manually from wordpress dashboard and send them an email with the password if you have access to the … Read more

Recover the user that have been deleted

Go into the Users section in the WP back end and type in the username that exists. You should find a record if it is still there. Deleting users completely deletes them – there is no “trash” normally, so the user should no longer exist in the database unless you have a plugin which keeps … Read more