Display the line breaks in user bio without using html
You could use “white-space: pre;” in CSS to display newlines as they are
You could use “white-space: pre;” in CSS to display newlines as they are
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.
We can check the $request which is passed to our login_redirect filter-function using url_to_postid. // redirect subscribers if logging in from specific page function wpse381872_login_redirect( $redirect_to, $request, $user ) { // turn the request url into a post-id $request_id = url_to_postid( $request ); if ( isset( $user->roles ) && is_array( $user->roles ) ) { // … Read more
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
You are updating the wrong column. user_nicename is used for the permalink of authors (so you really should undo your change if already done so in the actual database). If you want to change how usernames are displayed, update display_name instead. UPDATE wp_users SET display_name = CONCAT( (SELECT meta_value FROM wp_usermeta WHERE meta_key = ‘first_name’ … Read more
There is nothing in plain vanilla WordPress that would result in what you described. It would seem that your problem stems from customizing your process (either by plugin or by your own customization) to populate the user_login with the user’s email address to avoid having both a username and email. If it’s a custom process … Read more
There’s a complicated answer and a simple answer. The simple answer is, “You can’t.” WordPress requires three specific fields for every user – login (username), email, and password. Of those, login and email must be unique values. Email is necessary for a user to retrieve access to the site if they have forgotten their password. … Read more
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
You could use, what i call flag (don’t remember the profitional term but im sure there is one). The idea is to create a variable that has a boolean value, depends on the situation, for our example it will be false. So basicaly from the very start we assume that all fields have no values … Read more
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