Hot answers tagged

7

it's right here in the codex. This is example code, showing how a new user is created: $user_id = username_exists( $user_name ); if ( !$user_id and email_exists($user_email) == false ) { $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false ); $user_id = wp_create_user( $user_name, $random_password, $user_email )...


2

The function need a array with the parameters! see Codex Also you map the parameter with the value, like parameter 'user_email' => $_POST['user_email']. in your example like this: $user_id = (int) $_POST[ 'ID' ]; // correct ID wp_update_user( array( 'ID' => $user_id, 'user_email' => $_POST[ 'user_email' ] ); // correct ...


2

This is not a complete answer, but it's an attempt at giving you some direction. Hopefully with the community here we can come up with a solution for you! Firstly, I've been able to replicate your issue: I took your code and placed it in my theme's functions.php for now. I removed the if( $strict ) test I tried registering an 8 character Hebrew name - it ...


1

First you need to make group and subgroup. You can use wordpress existing User Role or you can make custom user role (group) by own. Members is a nice plugin to create custom role. For example your main group is "Group1" and subgroup is "Subgroup1". First you need to check current user role (Group of user). After that you can show full content for "Group1"...


1

Looks to me you should be seeking a woocommerce purchase completion hook. This would be when you could add that a donation has been made and at what amount, then you could grab any user information, amounted donated and other info you need and save it to your donor table. use this: add_action('woocommerce_order_status_completed', 'save_to_donors',10,1); ...


1

This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument. Not all user meta data has been stored in the database when this action is triggered. For example, nickname is in the database but first_name and last_name. The password has already been encrypted when ...


1

You are going in wrong direction there is no way to get user role while admin change from back end. You can retrieve the role object for the current user by calling get_role(), but that's an object rather than a string with the role name. function get_user_role($uid) { global $wpdb; $role = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} ...



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