Register through url

I see a few possibilities. When you generate the emails (I don’t know how you are doing this but we’ll skip that), register an user for each email generated. Then track the user logins. If, after a week or so, the user has not logged in, delete the user. When you generate the emails, generate … Read more

Register multiple users in one form

Update Found this awesome post http://tommcfarlin.com/create-a-user-in-wordpress/ that helped me solve the issue. It was for a product in Shopp where a user can sign up multiple users for a training course, and each email needed to be registered as a subscriber. This is the final code.. <?php add_action( ‘shopp_order_success’, ‘create_subscribers’ ); function create_subscribers( $Purchase ) … Read more

wp_insert_user function not adding password field to database

You don’t need to call ‘pre_user_*’ filters, that are called by WordPress inside wp_insert_user. Also I suggest to use php filter_input or filter_input_array to sanitize form input. Example code: $args = array( ‘pwd1’ => FILTER_SANITIZE_STRING, ‘pwd2’ => FILTER_SANITIZE_STRING, ‘first_name’ => FILTER_SANITIZE_STRING, ‘last_name’ => FILTER_SANITIZE_STRING, ‘username’ => FILTER_SANITIZE_STRING, ’email’ => FILTER_SANITIZE_STRING ); $form_data = filter_input_array( INPUT_POST, … Read more

Custom registration fields not validating

the value of the checkbox wouldn’t be “checked” – it should equal whatever you put in the “value” attribute .. and i think you need an extra set of parentheses in the if statement for first_name to make sure your filter is firing you could try explicitly adding an error (with no validation checks) to … Read more

register_settings callback function erases data

in case of wrong value, the function has to return the original value then try this : function email_validation($data, $option, $original_value) { if (null == $data) { add_settings_error( ‘requiredTextFieldEmpty’, ’empty’, ‘Notification Email cannot be empty’, ‘error’ ); return $original_value; } else { if (!is_email($data)){ add_settings_error( ‘requiredTextFieldEmpty’, ’empty’, ‘Notification Email is not valid email address’, ‘error’ … Read more

wp_insert_user not returning anything

I found out what it was. I had an action hook for user_register on my functions.php. This action hook would automatically login the user after registration. After removing it, it worked. As requested, the hook was interfearing because I was already logged in. The hook would use wp_set_current_user($user_id); wp_set_auth_cookie($user_id); to log in after registration.

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