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

Redirect after User Activation [closed]

Paste this code in your bp-custom.php file or, if you prefer, your active theme’s functions.php file: add_action( ‘bp_core_activated_user’, ‘wpse_70289_activated_user_redirect’ ); function wpse_70289_activated_user_redirect( $user_id ) { $registered_from = get_user_meta( $user_id, ‘registered_from’, true ); wp_redirect( $registered_from ); } I haven’t tested this code myself yet, but it should work just fine. References: http://codex.wordpress.org/Function_Reference/get_user_meta http://codex.wordpress.org/Function_Reference/wp_redirect

Can I hook into the invite user process to verify their email address is from a certain domain?

It is possible to hook into wpmu_validate_user_signup, which returns the $result of the sign-up process. Add another check for the email domain whitelist and add an error if not allowed. add_filter( ‘wpmu_validate_user_signup’, ‘whitelist_registration_wpse_82859’ ); function whitelist_registration_wpse_82859( $result ) { // Test array $whitelist = array( ‘gmail.com’, ‘mydomain.com’ ); // http://php.net/manual/en/function.explode.php $user_name_domain = explode( ‘@’, $result[‘user_email’] … Read more

Where to Store Custom User Fields

I know this question is very old, but I wanted to share my experience with working with large databases and storing custom user data. Basically wp_usermeta is the default and easiest option to store user meta and it works really well for smaller databases, where you might want to store a few extra fields for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)