Form doesn’t submit on second submit call

The php function which handles the submitted values in this plugin checks first if the button’s value isset. When using the original submit it is. When using preventDefault() and then calling submit() it isn’t and therefor the php doesn’t handle the submitted form but rebuilds it. To fix this I just added to the isset() … Read more

Registration options and approvals

The “Settings > General” Screen has a checkbox for “anyone can register.” This answers your second and third questions – it depends on how that setting is set. For your first question, that functionality is not built into WordPress. Perhaps a plugin like WP User Registration would suit your needs for this bit of functionality. … Read more

Does the user_register change in multisite?

There is the action hook wpmu_new_user. /* * Create a user. * * This function runs when a user self-registers as well as when * a Super Admin creates a new user. Hook to ‘wpmu_new_user’ for events * that should affect all new users, but only on Multisite (otherwise * use ‘user_register’).

How to add custom fields to my custom registration form

There’s wp_login_form() for such cases. It offers tons of hooks to extend it. // In your template wp_login_form( array( /* Args: refer to Codex page */ ) ); A more in-depth look at the filters, can be found here @GitHub WP Core source. ‘login_form_top’ – above login-username ‘login_form_middle’ – above login-submit ‘login_form_bottom’ – below login-submit … Read more

How to allow wordpress to create username with symbols like +

We need to add a filter to ‘sanitize_user’. Here is the sample code that will work for you. add_filter( ‘sanitize_user’, ‘tubs_sanitize_user’, 10, 3); function tubs_sanitize_user($username, $raw_username, $strict) { $new_username = strip_tags($raw_username); // Kill octets $new_username = preg_replace(‘|%([a-fA-F0-9][a-fA-F0-9])|’, ”, $new_username); $new_username = preg_replace(‘/&.?;/’, ”, $new_username); // Kill entities // If strict, reduce to ASCII for max … Read more

Two functions utilizing registration_errors filter

Identifying errors via error code Run add_user_to_SF with an earlier priority, to make it execute first add_filter( ‘registration_errors’, ‘add_user_to_SF’, 9, 3 );` Let’s assume you have two possible errors in your add_user_to_SF: function add_user_to_SF( $errors, $sanitized_user_login, $user_email ) { $has_errors = false; if ( /* some condition that should throw an error */ ) { … Read more

Average Account Age

WordPress records when a user was registered in the $wpdb->users (usually wp_users) table in the column user_registered. So you can use that to calculate the average account age. There’s no internal function for this, so you’ll have to use $wpdb directly. This stackoverflow answer has some good info about calculating the average of a series … Read more

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