predefined custom field on registration page

Find <div id=tab2_login” and replace it with following code.Assuming you will change CSS and JS accordingly. <div id=”tab2_login” class=”tab_content_login” style=”display:none;”> <h3>Register for this site!</h3> <p>Sign up now for the good stuff.</p> <form method=”post” action=”<?php echo site_url(‘wp-login.php?action=register’, ‘login_post’) ?>” class=”wp-user-form”> <div class=”username”> <label for=”user_login”><?php _e(‘Username’); ?>: </label> <input type=”text” name=”user_login” value=”<?php echo esc_attr(stripslashes($user_login)); ?>” size=”20″ id=”user_login” … Read more

How to Create WPMu New User?

You will need to give user2 Super Admin privileges by directly modifying the database. Run this query in phpMyAdmin: SELECT * FROM wp_sitemeta where meta_key=’site_admins’; This is an array of all your Super Admins. It should return something like this: a:1:{i:0;s:5:”user1″;} Note that 5 is the length of string ‘user1’. Here is an example modification … Read more

Get emails of register user in WordPress

The user table column you are searching for is user_email $emails = new WP_User_Query( array( ‘fields’ => array( ‘display_name’, ‘user_email’, ), // you don’t want everything, right? ‘orderby’ => ’email’, // ‘user_email’ works as well ‘order’ => ‘ASC’, // default: ‘DESC’ ‘number’ => 10, // total amount of users to return ‘offset’ => 0, // … Read more

How set role at registration based on email?

Here is a snippet that assign author role to a new registered member whose email is [email protected] where you need to modify to fit your needs: add_action( ‘user_register’, ‘user_register_cb’, 10, 1 ); function user_register_cb( $user_id ){ $user_info = get_userdata( $user_id ); $email = $user_info->user_email; $domain = ‘.co.uk’; $pos = strpos( $email, $domain ); if( $pos … Read more

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