How to display custom user meta from registration in backend?

Actually I found this to be more strait forward and simpler: //add columns to User panel list page function add_user_columns($column) { $column[‘address’] = ‘Street Address’; $column[‘zipcode’] = ‘Zip Code’; return $column; } add_filter( ‘manage_users_columns’, ‘add_user_columns’ ); //add the data function add_user_column_data( $val, $column_name, $user_id ) { $user = get_userdata($user_id); switch ($column_name) { case ‘address’ : … Read more

Show admin bar only for some USERS roles

You can disable the admin bar via function: show_admin_bar(false); So with that in mind, we can hook into after_setup_theme and hide the admin bar for all users except administrator and contributor: function cc_wpse_278096_disable_admin_bar() { if (current_user_can(‘administrator’) || current_user_can(‘contributor’) ) { // user can view admin bar show_admin_bar(true); // this line isn’t essentially needed by default… … Read more

How to let user set password on registration

Its Not has hard as you think it is 🙂 Add the password fields to your form : password: <input type=”password” name=”pass1″ style=”width:250px; margin-bottom:3px;”><br /> repeat password: <input type=”password” name=”pass2″ style=”width:250px; margin-bottom:3px;”><br /> then in your if($_POST){ replace this line: $random_password = wp_generate_password( 12, false ); with this: $pass1 = $wpdb->escape($_REQUEST[‘pass1’]); $pass2 = $wpdb->escape($_REQUEST[‘pass2’]); if … Read more

How to set up User email verification after Signup?

You can use user_register hook add_action( ‘user_register’, ‘my_registration’, 10, 2 ); function my_registration( $user_id ) { // get user data $user_info = get_userdata($user_id); // create md5 code to verify later $code = md5(time()); // make it into a code to send it to user via email $string = array(‘id’=>$user_id, ‘code’=>$code); // create the activation code … Read more

How to change user`s avatar?

Avatars are meant to be controlled by the user, not by you. So yes, in a way, you’re being forced to use the Gravatar service. But remember, it gives the user the ability to use the same avatar anywhere, and you can always restrict the display of a gravatar based on content ratings (G, PG, … Read more

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