Hook before user is created and make some custom validation

You need to add , 10, 3 after your closure to set the hook priority and (more importantly) the number of accepted arguments – otherwise $user_email and $errors will not be passed. add_action( ‘register_post’, function ( $user_login, $user_email, $errors ) { $userIsValid = ValidateUser::make($errors); if(!$userIsValid) { $errors->add( ‘bad_email_domain’, ‘<strong>ERROR</strong>: errors’ ); } }, 10, 3 … Read more

How does WP decide how to evaluate database integrity

I’ve finally found the answer. Yes WP was ‘triggered’ to think it was evaluating a WordPress and not a WordPress-MU table structure. This was caused by the following lines: define(‘WP_ALLOW_MULTISITE’, true); define( ‘MULTISITE’, true ); in the wp-config.php that should NOT be there in a WordPress-MU 2.9.2 installation (but that some former developer had tossed … Read more

Where this validating message come from?

Could you please show us your code or better yet provide an example? Sight unseen, my preliminary thought based on your description is that you are using some of the new HTML5 form elements and/or attributes. In particular, the required attribute would cause the error that you are seeing depending on the browser that you … Read more

W3C validation errors (trailing slashes)

Use a HTML5 document declaration: <!Doctype html> XML self closing slashes are allowed in HTML5. In an attempt to turn this into a WordPress question (really, it isn’t): WordPress spits out hard coded XHTML style in many places. Since most people will not send real XHTML, HTML5 is the best option to deal with WordPress’ … Read more

Verify Submitted Form Values and Show Warning Messages with Setting API

First add a validation callback to your register_settings: register_setting( ‘settingsapi_optiongroupname’, ‘settingsapi_optionname’,’validation_callback’); then define validation_callback: function validation_callback($input){ //check if all is good //If so then return the wanted value to be saved //If Not then hook your admin notice function and return null to be saved ex: if ($something){ return $input; }else{ add_settings_error(‘unique_identifyer’,esc_attr(‘settings_updated’),__(‘Settings saved.’),’updated’); add_action(‘admin_notices’, ‘print_errors’); … Read more

Front end post form validation

Using isset isn’t the best option, because when you submit the form the post variables will still be set, just to null. You should check if the values are null. Also you are echoing the validation error messages, when you should be assigning them to a variable and returning the variable, then outputting the returned … Read more

How to do more than one verify_nonce in one function?

Nonce generated is product of: user ID time $action argument The action is important part and needs to precisely describe what kind of event you are verifying. So if your actions are create something and delete something, your nonces should be generated for example like my_prefix_create and my_prefix_delete and verified accordingly.

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