Send clear password via mail

user_register isn’t the solution for your needs because when this action is trigger, the password is already encrypted. The best solution is to do a custom registration form and insert your new users with this hook: wp_insert_user() When a user is register, you can send a custom email with the password not encrypted.

Load user by specific role

One possible way is by using the role__not_in parameter like so which excludes all other roles except subscriber: // Include only the following role(s): $roles_in = array( ‘subscriber’ ); $roles_not_in = array_diff( array_keys( wp_roles()->get_names() ), $roles_in ); $args = array( ‘role__not_in’ => $roles_not_in, ); $subscribers = get_users( $args ); But of course, if you know … Read more

WP_User_Query combining role and ids

As I was told above in the comment, WP_User_Query does not support the nested sub-arrays… So at the end I solved the thing by separated queries… Not sure whether there is more efficient way, but in case somebody needs an inspiration, below is my solution of the problem. // get ids of first set of … Read more

No more administrator roles / permissions after WordPress upgrade

You can recreate the administrator role: wp –skip-plugins role create administrator Administrator wp –skip-plugins role reset administrator Restored 61 capabilities to and removed 0 capabilities from ‘administrator’ role. Success: Role reset. wp –skip-plugins user set-role YOURUSERNAMEHERE administrator

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