Sanificare email

  programmazione wordpress, wordpress

programmazione wordpress

function ozhwpe_validate_options( $input ) {
	$valid = array();
	$valid['boss_email'] = sanitize_email( $input['boss_email'] );
	
	// Something dirty entered? Warn user.
	if( $valid['boss_email'] != $input['boss_email'] ) {
		add_settings_error(
			'ozhwpe_boss_email',           // setting title
			'ozhwpe_texterror',            // error ID
			'Invalid email, please fix',   // error message
			'error'                        // type of message
		);		
	}
	
	return $valid;
}

SCRIVI UN COMMENTO