Tag Info

Hot answers tagged

2

I believe Crazycoolcam spelled the table incorrectly, user_meta vs usermeta. You may also want to define the else case, what happens if the table is not user. Try this: <?php $wpdb->add_database(array( //Connect to Users Database 'host' => DB_HOST, // I am using the same host for my two DBs 'user' => DB_USER, ...


1

For this, you have to use user_register hook defined on wp-includes/users.php line 1759. personal_options_update hook is called, when an user updating his own profile. edit_user_profile_update is called, when an administrator updating other user profile. nothing is called, when an administrator creating a new user. On user-new.php page, new user are ...


1

This will add a new column to the Users admin and show their last login. <?php /* Plugin Name: (#158276) WPSE | Last user login */ // Add user meta `last_login` that saves the UNIX time stamp // to identify the exact time when a user logged in add_action( 'wp_login', 'add_login_time' ); function add_login_time( $user_login ) { global $wpdb; ...


1

You have to use the function get_user_meta $new_user = get_userdata($user_id); // get all the meta data of the user $new_user_data = get_user_meta( $user_id ); // get the first name of the user as a string $new_user_firstname = get_user_meta( $user_id, 'first_name', true );


1

Your code does work. It's just that you are declaring $xfield_args after you have made the call xprofile_insert_field( $xfield_args ); it should look like this add_action('bp_init', 'field_xprofile_twitter'); function field_xprofile_twitter() { global $bp; $xfield_args = array ( field_group_id => 1, name => ...



Only top voted, non community-wiki answers of a minimum length are eligible