Tag Info

New answers tagged

0

You may try a very different approach which I just used recently. Try out the WordPress plugin Pie Register for that, it gives you an easy drag-and-drop interface for customising your registration form, adding custom fields of all sorts and the e-mails being sent and who is being activated. Hope this is what you need!


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

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 => ...


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

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; ...


0

pre_user_query is called after the query variable object is created, but before the actual query is run. Your code is creating a new query within the action when you should actually take the existing query and modify its arguments using the $query->set() method. For example: function my_pre_user_search($user_query) { $meta_query = array(array( ...


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 ...


0

I figured it out myself so I will post the answer here, please note that the original answer can also be found on StackOverflow. If the mods feel like this should be deleted from here and only remain, please go ahead. I thought it might be useful on both places. First the correct code, then an explaination: // Here we add a new user role, "cliente". ...



Top 50 recent answers are included