/** * Prevent certain names from the Name form field. * * @link https://wpforms.com/developers/how-to-block-names-from-completing-your-form/ * */ function wpf_dev_block_name_validation( $field_id, $field_submit, $form_data ) { // Bail early if form ID is not 408 and field ID is not 1 if ( absint( $form_data['id'] ) !== 408 && $field_id !== 1 ) { return; } // Form builder Name format is set to First Last $submitted_name = $field_submit['first'] .' ' .$field_submit[ 'last' ]; // Create your list of names to be blocked separated by commas $blocked_names = array( 'Crytomoult Crytomoult', 'Dyan Dyan', 'ErnestPerFO ErnestPer' ); foreach( $blocked_names as $name ) { if( strcmp( ucwords($submitted_name), $name ) == 0 ) { wpforms()->process->errors[ $form_data['id'] ]['header'] = esc_html__( 'Can\'t submit form. Please try again later.', 'wpforms' ); return; } } } add_action( 'wpforms_process_validate_name', 'wpf_dev_block_name_validation', 10, 3 );

contact

Book Royalty

Personal Info

Venue Details

Email

mina@thepalaceent.com

Phone

+1 (201) 920-8100