Showing the user’s username in registration email or activation page with BuddyPress [closed]

You can add the username to the activation e-mail by adding this code either to the bp-custom.php or to the theme’s functions.php file add_filter(‘bp_core_signup_send_validation_email_message’, ‘add_username_to_activation_email’,10,3); function add_username_to_activation_email($msg, $u_id, $activation_url) { $username = $_POST[‘signup_username’]; $msg .= sprintf( __(“After successful activation, you can log in using your username (%1\$s) along with password you choose during registration process.”, … Read more

Change default ordering of display name

AFAIK the default option in the display name dropdown is set to the current value of user display name. So, if we on user creation set display_name to “Lastname Firstname”, then this will be used as default. This can be done hooking user_register: add_action(‘user_register’, ‘last_name_first’); function last_name_first( $uid ) { remove_action(‘user_register’, ‘last_name_first’); $user = new … Read more

auto assign sequence base username while registration

This all depends on how users are being registered on your site. TLDR The code below allows you to create custom users from admin area specifying custom usernames, or use GENERATE_CUSTOM_SEQ_USERNAME to generate sequential numbered one. If using registration form other than wp-login.php just set user_login to GENERATE_CUSTOM_SEQ_USERNAME and hide the field using CSS. If … Read more

Username field is not shown in Woocommerce’s registration contact form

I just fund the tricky solution, it was very simple and I did think about it. I just went to WooCommerce -> Settings -> Accounts and I untick the checkbox for “Automatically generate username from customer email”. I got the solution from this topic but here the problem was the contrary: https://stackoverflow.com/questions/32781569/remove-username-field-registration-form-woocommerce

Update user_login to change username

First: The $wpdb object has the names of tables, with prefixes, pre-defined for you. $wpdb->users == ‘wp_users’ $wpdb->posts == ‘wp_posts’ etc. Second: $wpdb-prepare() is essentially a WordPress aware printf, if you pass it more than one argument, you need to have some string/digit replacements %s %d $sql = “UPDATE {$wpdb->users} SET user_login = %s WHERE … Read more

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