Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/module
File: ContactFormItem.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Contact_Form_Item extends ET_Builder_Module {
[2] Fix | Delete
[3] Fix | Delete
public $additional_shortcode_slugs = array( 'et_pb_signup_custom_field' );
[4] Fix | Delete
[5] Fix | Delete
function init() {
[6] Fix | Delete
$this->name = esc_html__( 'Field', 'et_builder' );
[7] Fix | Delete
$this->plural = esc_html__( 'Fields', 'et_builder' );
[8] Fix | Delete
$this->slug = 'et_pb_contact_field';
[9] Fix | Delete
$this->vb_support = 'on';
[10] Fix | Delete
$this->type = 'child';
[11] Fix | Delete
$this->child_title_var = 'field_id';
[12] Fix | Delete
$this->advanced_setting_title_text = esc_html__( 'New Field', 'et_builder' );
[13] Fix | Delete
$this->settings_text = esc_html__( 'Field Settings', 'et_builder' );
[14] Fix | Delete
$this->main_css_element = '.et_pb_contact_form_container %%order_class%%.et_pb_contact_field';
[15] Fix | Delete
[16] Fix | Delete
$this->settings_modal_toggles = array(
[17] Fix | Delete
'general' => array(
[18] Fix | Delete
'toggles' => array(
[19] Fix | Delete
'main_content' => et_builder_i18n( 'Text' ),
[20] Fix | Delete
'field_options' => esc_html__( 'Field Options', 'et_builder' ),
[21] Fix | Delete
'conditional_logic' => esc_html__( 'Conditional Logic', 'et_builder' ),
[22] Fix | Delete
),
[23] Fix | Delete
),
[24] Fix | Delete
'advanced' => array(
[25] Fix | Delete
'toggles' => array(
[26] Fix | Delete
'layout' => et_builder_i18n( 'Layout' ),
[27] Fix | Delete
),
[28] Fix | Delete
),
[29] Fix | Delete
);
[30] Fix | Delete
[31] Fix | Delete
$this->advanced_fields = array(
[32] Fix | Delete
'borders' => array(
[33] Fix | Delete
'default' => array(
[34] Fix | Delete
'css' => array(
[35] Fix | Delete
'main' => array(
[36] Fix | Delete
'border_radii' => sprintf( '%1$s .input, %1$s .input[type="checkbox"] + label i, %1$s .input[type="radio"] + label i', $this->main_css_element ),
[37] Fix | Delete
'border_styles' => sprintf( '%1$s .input, %1$s .input[type="checkbox"] + label i, %1$s .input[type="radio"] + label i', $this->main_css_element ),
[38] Fix | Delete
),
[39] Fix | Delete
'important' => 'plugin_only',
[40] Fix | Delete
),
[41] Fix | Delete
'label_prefix' => esc_html__( 'Input', 'et_builder' ),
[42] Fix | Delete
),
[43] Fix | Delete
),
[44] Fix | Delete
'box_shadow' => array(
[45] Fix | Delete
'default' => array(
[46] Fix | Delete
'css' => array(
[47] Fix | Delete
'main' => implode( ', ', array(
[48] Fix | Delete
'%%order_class%% input',
[49] Fix | Delete
'%%order_class%% select',
[50] Fix | Delete
'%%order_class%% textarea',
[51] Fix | Delete
'%%order_class%% .et_pb_contact_field_options_list label > i',
[52] Fix | Delete
) ),
[53] Fix | Delete
'important' => true,
[54] Fix | Delete
),
[55] Fix | Delete
),
[56] Fix | Delete
),
[57] Fix | Delete
'background' => array(
[58] Fix | Delete
'css' => array(
[59] Fix | Delete
'main' => '%%order_class%%',
[60] Fix | Delete
),
[61] Fix | Delete
),
[62] Fix | Delete
'margin_padding' => array(
[63] Fix | Delete
'css' => array(
[64] Fix | Delete
'padding' => 'p%%order_class%%',
[65] Fix | Delete
'important' => array( 'custom_margin' ), // needed to overwrite last module margin-bottom styling
[66] Fix | Delete
),
[67] Fix | Delete
),
[68] Fix | Delete
'text' => array(
[69] Fix | Delete
'css' => array(
[70] Fix | Delete
'text_orientation' => '%%order_class%% input, %%order_class%% textarea, %%order_class%% label',
[71] Fix | Delete
),
[72] Fix | Delete
),
[73] Fix | Delete
'text_shadow' => array(
[74] Fix | Delete
// Don't add text-shadow fields since they already are via font-options
[75] Fix | Delete
'default' => false,
[76] Fix | Delete
),
[77] Fix | Delete
'filters' => array(
[78] Fix | Delete
'css' => array(
[79] Fix | Delete
'main' => array(
[80] Fix | Delete
'%%order_class%% input',
[81] Fix | Delete
'%%order_class%% textarea',
[82] Fix | Delete
'%%order_class%% label',
[83] Fix | Delete
),
[84] Fix | Delete
),
[85] Fix | Delete
),
[86] Fix | Delete
'button' => false,
[87] Fix | Delete
'form_field' => array(
[88] Fix | Delete
'form_field' => array(
[89] Fix | Delete
'label' => esc_html__( 'Field', 'et_builder' ),
[90] Fix | Delete
'css' => array(
[91] Fix | Delete
'background_color' => '%%order_class%% .input, %%order_class%% .input[type="checkbox"] + label i, %%order_class%% .input[type="radio"] + label i',
[92] Fix | Delete
[93] Fix | Delete
'main' => '%%order_class%%.et_pb_contact_field .input',
[94] Fix | Delete
'background_color' => '%%order_class%%.et_pb_contact_field .input, %%order_class%%.et_pb_contact_field .input[type="checkbox"] + label i, %%order_class%%.et_pb_contact_field .input[type="radio"] + label i',
[95] Fix | Delete
'background_color_hover' => '%%order_class%%.et_pb_contact_field .input:hover, %%order_class%%.et_pb_contact_field .input[type="checkbox"] + label:hover i, %%order_class%%.et_pb_contact_field .input[type="radio"] + label:hover i',
[96] Fix | Delete
'focus_background_color' => '%%order_class%%.et_pb_contact_field .input:focus, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:active + label i, %%order_class%%.et_pb_contact_field .input[type="radio"]:active + label i',
[97] Fix | Delete
'focus_background_color_hover' => '%%order_class%%.et_pb_contact_field .input:focus:hover, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:active:hover + label i, %%order_class%%.et_pb_contact_field .input[type="radio"]:active:hover + label i',
[98] Fix | Delete
'form_text_color' => '%%order_class%%.et_pb_contact_field .input, %%order_class%%.et_pb_contact_field .input[type="checkbox"] + label, %%order_class%%.et_pb_contact_field .input[type="radio"] + label, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:checked + label i:before',
[99] Fix | Delete
'form_text_color_hover' => '%%order_class%%.et_pb_contact_field .input:hover, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:hover + label,
[100] Fix | Delete
%%order_class%%.et_pb_contact_field .input[type="radio"]:hover + label, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:checked:hover + label i:before',
[101] Fix | Delete
'focus_text_color' => '%%order_class%%.et_pb_contact_field .input:focus, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:active + label,
[102] Fix | Delete
%%order_class%%.et_pb_contact_field .input[type="radio"]:active + label, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:checked:active + label i:before',
[103] Fix | Delete
'focus_text_color_hover' => '%%order_class%%.et_pb_contact_field .input:focus:hover, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:active:hover + label,
[104] Fix | Delete
%%order_class%%.et_pb_contact_field .input[type="radio"]:active:hover + label, %%order_class%%.et_pb_contact_field .input[type="checkbox"]:checked:active:hover + label i:before',
[105] Fix | Delete
),
[106] Fix | Delete
'margin_padding' => false,
[107] Fix | Delete
'box_shadow' => false,
[108] Fix | Delete
'border_styles' => false,
[109] Fix | Delete
'font_field' => array(
[110] Fix | Delete
'css' => array(
[111] Fix | Delete
'main' => implode( ',', array(
[112] Fix | Delete
'%%order_class%%.et_pb_contact_field .et_pb_contact_field_options_title',
[113] Fix | Delete
"{$this->main_css_element} .input",
[114] Fix | Delete
"{$this->main_css_element} .input::placeholder",
[115] Fix | Delete
"{$this->main_css_element} .input::-webkit-input-placeholder",
[116] Fix | Delete
"{$this->main_css_element} .input::-moz-placeholder",
[117] Fix | Delete
"{$this->main_css_element} .input:-ms-input-placeholder",
[118] Fix | Delete
"{$this->main_css_element} .input[type=checkbox] + label",
[119] Fix | Delete
"{$this->main_css_element} .input[type=radio] + label",
[120] Fix | Delete
) ),
[121] Fix | Delete
'important' => 'plugin_only',
[122] Fix | Delete
),
[123] Fix | Delete
),
[124] Fix | Delete
),
[125] Fix | Delete
),
[126] Fix | Delete
'height' => array(
[127] Fix | Delete
'css' => array(
[128] Fix | Delete
'main' => implode(', ', array(
[129] Fix | Delete
'%%order_class%% input[type=text]',
[130] Fix | Delete
'%%order_class%% input[type=email]',
[131] Fix | Delete
'%%order_class%% textarea',
[132] Fix | Delete
'%%order_class%%[data-type=checkbox]',
[133] Fix | Delete
'%%order_class%%[data-type=radio]',
[134] Fix | Delete
'%%order_class%%[data-type=select]',
[135] Fix | Delete
'%%order_class%%[data-type=select] select',
[136] Fix | Delete
))
[137] Fix | Delete
)
[138] Fix | Delete
),
[139] Fix | Delete
);
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
function get_fields() {
[143] Fix | Delete
$labels = array(
[144] Fix | Delete
'link_url' => esc_html__( 'Link URL', 'et_builder' ),
[145] Fix | Delete
'link_text' => esc_html__( 'Link Text', 'et_builder' ),
[146] Fix | Delete
'link_cancel' => esc_html__( 'Discard Changes', 'et_builder' ),
[147] Fix | Delete
'link_save' => esc_html__( 'Save Changes', 'et_builder' ),
[148] Fix | Delete
'link_settings' => esc_html__( 'Option Link', 'et_builder' ),
[149] Fix | Delete
);
[150] Fix | Delete
[151] Fix | Delete
$fields = array(
[152] Fix | Delete
'field_id' => array(
[153] Fix | Delete
'label' => esc_html__( 'Field ID', 'et_builder' ),
[154] Fix | Delete
'type' => 'text',
[155] Fix | Delete
'description' => esc_html__( 'Define the unique ID of this field. You should use only English characters without special characters and spaces.', 'et_builder' ),
[156] Fix | Delete
'toggle_slug' => 'main_content',
[157] Fix | Delete
'default_on_front' => '',
[158] Fix | Delete
'option_category' => 'basic_option',
[159] Fix | Delete
),
[160] Fix | Delete
'field_title' => array(
[161] Fix | Delete
'label' => et_builder_i18n( 'Title' ),
[162] Fix | Delete
'type' => 'text',
[163] Fix | Delete
'description' => esc_html__( 'Here you can define the content that will be placed within the current tab.', 'et_builder' ),
[164] Fix | Delete
'toggle_slug' => 'main_content',
[165] Fix | Delete
'default_on_front' => esc_html__( 'New Field', 'et_builder' ),
[166] Fix | Delete
'option_category' => 'basic_option',
[167] Fix | Delete
'mobile_options' => true,
[168] Fix | Delete
'hover' => 'tabs',
[169] Fix | Delete
),
[170] Fix | Delete
'field_type' => array(
[171] Fix | Delete
'label' => esc_html__( 'Type', 'et_builder' ),
[172] Fix | Delete
'type' => 'select',
[173] Fix | Delete
'default' => 'input',
[174] Fix | Delete
'option_category' => 'basic_option',
[175] Fix | Delete
'options' => array(
[176] Fix | Delete
'input' => esc_html__( 'Input Field', 'et_builder' ),
[177] Fix | Delete
'email' => esc_html__( 'Email Field', 'et_builder' ),
[178] Fix | Delete
'text' => esc_html__( 'Textarea', 'et_builder' ),
[179] Fix | Delete
'checkbox' => esc_html__( 'Checkboxes', 'et_builder' ),
[180] Fix | Delete
'radio' => esc_html__( 'Radio Buttons', 'et_builder' ),
[181] Fix | Delete
'select' => esc_html__( 'Select Dropdown', 'et_builder' ),
[182] Fix | Delete
),
[183] Fix | Delete
'description' => esc_html__( 'Choose the type of field', 'et_builder' ),
[184] Fix | Delete
'affects' => array(
[185] Fix | Delete
'checkbox_options',
[186] Fix | Delete
'radio_options',
[187] Fix | Delete
'select_options',
[188] Fix | Delete
'min_length',
[189] Fix | Delete
'max_length',
[190] Fix | Delete
'allowed_symbols',
[191] Fix | Delete
),
[192] Fix | Delete
'toggle_slug' => 'field_options',
[193] Fix | Delete
),
[194] Fix | Delete
'checkbox_checked' => array(
[195] Fix | Delete
'label' => esc_html__( 'Checked By Default', 'et_builder' ),
[196] Fix | Delete
'description' => esc_html__( 'If enabled, the check mark will be automatically selected for the visitor. They can still deselected it.', 'et_builder' ),
[197] Fix | Delete
'type' => 'hidden',
[198] Fix | Delete
'option_category' => 'layout',
[199] Fix | Delete
'default' => 'off',
[200] Fix | Delete
'depends_show_if' => 'checkbox',
[201] Fix | Delete
'toggle_slug' => 'field_options',
[202] Fix | Delete
),
[203] Fix | Delete
'checkbox_options' => array(
[204] Fix | Delete
'label' => esc_html__( 'Options', 'et_builder' ),
[205] Fix | Delete
'type' => 'sortable_list',
[206] Fix | Delete
'checkbox' => true,
[207] Fix | Delete
'option_category' => 'basic_option',
[208] Fix | Delete
'depends_show_if' => 'checkbox',
[209] Fix | Delete
'toggle_slug' => 'field_options',
[210] Fix | Delete
'right_actions' => 'move|link|copy|delete',
[211] Fix | Delete
'labels' => $labels,
[212] Fix | Delete
),
[213] Fix | Delete
'radio_options' => array(
[214] Fix | Delete
'label' => esc_html__( 'Options', 'et_builder' ),
[215] Fix | Delete
'type' => 'sortable_list',
[216] Fix | Delete
'radio' => true,
[217] Fix | Delete
'option_category' => 'basic_option',
[218] Fix | Delete
'depends_show_if' => 'radio',
[219] Fix | Delete
'toggle_slug' => 'field_options',
[220] Fix | Delete
'right_actions' => 'move|link|copy|delete',
[221] Fix | Delete
'labels' => $labels,
[222] Fix | Delete
),
[223] Fix | Delete
'select_options' => array(
[224] Fix | Delete
'label' => esc_html__( 'Options', 'et_builder' ),
[225] Fix | Delete
'type' => 'sortable_list',
[226] Fix | Delete
'option_category' => 'basic_option',
[227] Fix | Delete
'depends_show_if' => 'select',
[228] Fix | Delete
'toggle_slug' => 'field_options',
[229] Fix | Delete
),
[230] Fix | Delete
'min_length' => array(
[231] Fix | Delete
'label' => esc_html__( 'Minimum Length', 'et_builder' ),
[232] Fix | Delete
'description' => esc_html__( 'Leave at 0 to remove restriction', 'et_builder' ),
[233] Fix | Delete
'type' => 'range',
[234] Fix | Delete
'default' => '0',
[235] Fix | Delete
'unitless' => true,
[236] Fix | Delete
'range_settings' => array(
[237] Fix | Delete
'min' => '0',
[238] Fix | Delete
'max' => '255',
[239] Fix | Delete
'step' => '1',
[240] Fix | Delete
),
[241] Fix | Delete
'option_category' => 'basic_option',
[242] Fix | Delete
'depends_show_if' => 'input',
[243] Fix | Delete
'toggle_slug' => 'field_options',
[244] Fix | Delete
),
[245] Fix | Delete
'max_length' => array(
[246] Fix | Delete
'label' => esc_html__( 'Maximum Length', 'et_builder' ),
[247] Fix | Delete
'description' => esc_html__( 'Leave at 0 to remove restriction', 'et_builder' ),
[248] Fix | Delete
'type' => 'range',
[249] Fix | Delete
'default' => '0',
[250] Fix | Delete
'unitless' => true,
[251] Fix | Delete
'range_settings' => array(
[252] Fix | Delete
'min' => '0',
[253] Fix | Delete
'max' => '255',
[254] Fix | Delete
'step' => '1',
[255] Fix | Delete
),
[256] Fix | Delete
'option_category' => 'basic_option',
[257] Fix | Delete
'depends_show_if' => 'input',
[258] Fix | Delete
'toggle_slug' => 'field_options',
[259] Fix | Delete
),
[260] Fix | Delete
'allowed_symbols' => array(
[261] Fix | Delete
'label' => esc_html__( 'Allowed Symbols', 'et_builder' ),
[262] Fix | Delete
'type' => 'select',
[263] Fix | Delete
'default' => 'all',
[264] Fix | Delete
'options' => array(
[265] Fix | Delete
'all' => esc_html__( 'All', 'et_builder' ),
[266] Fix | Delete
'letters' => esc_html__( 'Letters Only (A-Z)', 'et_builder' ),
[267] Fix | Delete
'numbers' => esc_html__( 'Numbers Only (0-9)', 'et_builder' ),
[268] Fix | Delete
'alphanumeric' => esc_html__( 'Alphanumeric Only (A-Z, 0-9)', 'et_builder' ),
[269] Fix | Delete
),
[270] Fix | Delete
'option_category' => 'basic_option',
[271] Fix | Delete
'depends_show_if' => 'input',
[272] Fix | Delete
'toggle_slug' => 'field_options',
[273] Fix | Delete
),
[274] Fix | Delete
'required_mark' => array(
[275] Fix | Delete
'label' => esc_html__( 'Required Field', 'et_builder' ),
[276] Fix | Delete
'type' => 'yes_no_button',
[277] Fix | Delete
'option_category' => 'configuration',
[278] Fix | Delete
'default' => 'on',
[279] Fix | Delete
'options' => array(
[280] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[281] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[282] Fix | Delete
),
[283] Fix | Delete
'description' => esc_html__( 'Define whether the field should be required or optional', 'et_builder' ),
[284] Fix | Delete
'toggle_slug' => 'field_options',
[285] Fix | Delete
),
[286] Fix | Delete
'fullwidth_field' => array(
[287] Fix | Delete
'label' => esc_html__( 'Make Fullwidth', 'et_builder' ),
[288] Fix | Delete
'type' => 'yes_no_button',
[289] Fix | Delete
'option_category' => 'layout',
[290] Fix | Delete
'options' => array(
[291] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[292] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[293] Fix | Delete
),
[294] Fix | Delete
'tab_slug' => 'advanced',
[295] Fix | Delete
'toggle_slug' => 'layout',
[296] Fix | Delete
'description' => esc_html__( 'If enabled, the field will take 100% of the width of the content area, otherwise it will take 50%', 'et_builder' ),
[297] Fix | Delete
'default_on_front' => 'off',
[298] Fix | Delete
),
[299] Fix | Delete
'conditional_logic' => array(
[300] Fix | Delete
'label' => esc_html__( 'Enable', 'et_builder' ),
[301] Fix | Delete
'type' => 'yes_no_button',
[302] Fix | Delete
'option_category' => 'layout',
[303] Fix | Delete
'default' => 'off',
[304] Fix | Delete
'options' => array(
[305] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[306] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[307] Fix | Delete
),
[308] Fix | Delete
'affects' => array(
[309] Fix | Delete
'conditional_logic_rules',
[310] Fix | Delete
'conditional_logic_relation',
[311] Fix | Delete
),
[312] Fix | Delete
'description' => et_get_safe_localization( __( "Enabling conditional logic makes this field only visible when any or all of the rules below are fulfilled<br><strong>Note:</strong> Only fields with an unique and non-empty field ID can be used", 'et_builder' ) ),
[313] Fix | Delete
'toggle_slug' => 'conditional_logic',
[314] Fix | Delete
),
[315] Fix | Delete
'conditional_logic_relation' => array(
[316] Fix | Delete
'label' => esc_html__( 'Relation', 'et_builder' ),
[317] Fix | Delete
'type' => 'yes_no_button',
[318] Fix | Delete
'option_category' => 'layout',
[319] Fix | Delete
'options' => array(
[320] Fix | Delete
'on' => esc_html__( 'All', 'et_builder' ),
[321] Fix | Delete
'off' => esc_html__( 'Any', 'et_builder' ),
[322] Fix | Delete
),
[323] Fix | Delete
'default' => 'off',
[324] Fix | Delete
'button_options' => array(
[325] Fix | Delete
'button_type' => 'equal',
[326] Fix | Delete
),
[327] Fix | Delete
'depends_show_if' => 'on',
[328] Fix | Delete
'description' => esc_html__( 'Choose whether any or all of the rules should be fulfilled', 'et_builder' ),
[329] Fix | Delete
'toggle_slug' => 'conditional_logic',
[330] Fix | Delete
),
[331] Fix | Delete
'conditional_logic_rules' => array(
[332] Fix | Delete
'label' => esc_html__( 'Rules', 'et_builder' ),
[333] Fix | Delete
'type' => 'conditional_logic',
[334] Fix | Delete
'option_category' => 'layout',
[335] Fix | Delete
'depends_show_if' => 'on',
[336] Fix | Delete
'toggle_slug' => 'conditional_logic',
[337] Fix | Delete
),
[338] Fix | Delete
);
[339] Fix | Delete
[340] Fix | Delete
return $fields;
[341] Fix | Delete
}
[342] Fix | Delete
[343] Fix | Delete
public function get_transition_fields_css_props() {
[344] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[345] Fix | Delete
[346] Fix | Delete
$fields['form_field_background_color'] = array(
[347] Fix | Delete
'background' => implode( ', ', array(
[348] Fix | Delete
'%%order_class%%.et_pb_contact_field .input',
[349] Fix | Delete
'%%order_class%%.et_pb_contact_field .input + label:hover i'
[350] Fix | Delete
) )
[351] Fix | Delete
);
[352] Fix | Delete
[353] Fix | Delete
return $fields;
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
function render( $attrs, $content = null, $render_slug ) {
[357] Fix | Delete
global $et_pb_half_width_counter, $et_pb_contact_form_num;
[358] Fix | Delete
[359] Fix | Delete
et_core_nonce_verified_previously();
[360] Fix | Delete
[361] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[362] Fix | Delete
$field_title = $this->props['field_title'];
[363] Fix | Delete
$field_type = $this->props['field_type'];
[364] Fix | Delete
$field_id = $this->props['field_id'];
[365] Fix | Delete
$required_mark = $this->props['required_mark'];
[366] Fix | Delete
$fullwidth_field = $this->props['fullwidth_field'];
[367] Fix | Delete
$form_field_text_color = $this->props['form_field_text_color'];
[368] Fix | Delete
$checkbox_checked = $this->props['checkbox_checked'];
[369] Fix | Delete
$checkbox_options = $this->props['checkbox_options'];
[370] Fix | Delete
$radio_options = $this->props['radio_options'];
[371] Fix | Delete
$select_options = $this->props['select_options'];
[372] Fix | Delete
$min_length = $this->props['min_length'];
[373] Fix | Delete
$max_length = $this->props['max_length'];
[374] Fix | Delete
$conditional_logic = $this->props['conditional_logic'];
[375] Fix | Delete
$conditional_logic_relation = $this->props['conditional_logic_relation'];
[376] Fix | Delete
$conditional_logic_rules = $this->props['conditional_logic_rules'];
[377] Fix | Delete
$allowed_symbols = $this->props['allowed_symbols'];
[378] Fix | Delete
$render_count = $this->render_count();
[379] Fix | Delete
$current_module_num = null === $et_pb_contact_form_num ? 0 : intval( $et_pb_contact_form_num ) + 1;
[380] Fix | Delete
[381] Fix | Delete
$field_text_color_hover = $this->get_hover_value( 'form_field_text_color' );
[382] Fix | Delete
$field_text_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'form_field_text_color' );
[383] Fix | Delete
$field_focus_text_color_hover = $this->get_hover_value( 'form_field_focus_text_color' );
[384] Fix | Delete
$field_focus_text_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'form_field_focus_text_color' );
[385] Fix | Delete
[386] Fix | Delete
// set a field ID.
[387] Fix | Delete
if ( '' === $field_id ) {
[388] Fix | Delete
$field_id = sprintf( 'field_%d_%d', $et_pb_contact_form_num, $render_count );
[389] Fix | Delete
}
[390] Fix | Delete
[391] Fix | Delete
if ( 'et_pb_signup_custom_field' === $render_slug ) {
[392] Fix | Delete
$this->add_classname( 'et_pb_newsletter_field' );
[393] Fix | Delete
} else {
[394] Fix | Delete
$field_id = strtolower( $field_id );
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
$video_background = $this->video_background();
[398] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[399] Fix | Delete
[400] Fix | Delete
$et_pb_half_width_counter = ! isset( $et_pb_half_width_counter ) ? 0 : $et_pb_half_width_counter;
[401] Fix | Delete
[402] Fix | Delete
// count fields to add the et_pb_contact_field_last properly
[403] Fix | Delete
if ( 'off' === $fullwidth_field ) {
[404] Fix | Delete
$et_pb_half_width_counter++;
[405] Fix | Delete
} else {
[406] Fix | Delete
$et_pb_half_width_counter = 0;
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
$input_field = '';
[410] Fix | Delete
[411] Fix | Delete
// Form Field Text Color - Radio Checked.
[412] Fix | Delete
$field_text_color_important = et_builder_has_limitation( 'force_use_global_important' ) ? ' !important' : '';
[413] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $field_text_color_values, '%%order_class%%.et_pb_contact_field .input[type="radio"]:checked + label i:before', 'background-color', $render_slug, $field_text_color_important, 'color' );
[414] Fix | Delete
[415] Fix | Delete
if ( et_builder_is_hover_enabled( 'form_field_text_color', $this->props ) ) {
[416] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[417] Fix | Delete
'selector' => '%%order_class%%.et_pb_contact_field .input[type="radio"]:checked:hover + label i:before',
[418] Fix | Delete
'declaration' => sprintf(
[419] Fix | Delete
'background-color: %1$s%2$s;',
[420] Fix | Delete
esc_html( $field_text_color_hover ),
[421] Fix | Delete
$field_text_color_important
[422] Fix | Delete
),
[423] Fix | Delete
) );
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
// Form Field Text Color on Focus - Radio Checked.
[427] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $field_focus_text_color_values, '%%order_class%%.et_pb_contact_field .input[type="radio"]:checked:active + label i:before', 'background-color', $render_slug, $field_text_color_important, 'color' );
[428] Fix | Delete
[429] Fix | Delete
if ( et_builder_is_hover_enabled( 'form_field_focus_text_color', $this->props ) ) {
[430] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[431] Fix | Delete
'selector' => '%%order_class%%.et_pb_contact_field .input[type="radio"]:checked:active:hover + label i:before',
[432] Fix | Delete
'declaration' => sprintf(
[433] Fix | Delete
'background-color: %1$s%2$s;',
[434] Fix | Delete
esc_html( $field_focus_text_color_hover ),
[435] Fix | Delete
$field_text_color_important
[436] Fix | Delete
),
[437] Fix | Delete
) );
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
$pattern = '';
[441] Fix | Delete
$title = '';
[442] Fix | Delete
$min_length = intval( $min_length );
[443] Fix | Delete
$max_length = intval( $max_length );
[444] Fix | Delete
$max_length_attr = '';
[445] Fix | Delete
$symbols_pattern = '.';
[446] Fix | Delete
$length_pattern = '*';
[447] Fix | Delete
[448] Fix | Delete
if ( in_array( $allowed_symbols, array( 'letters', 'numbers', 'alphanumeric' ) ) ) {
[449] Fix | Delete
switch ( $allowed_symbols ) {
[450] Fix | Delete
case 'letters':
[451] Fix | Delete
$symbols_pattern = '[A-Z|a-z|\s-]';
[452] Fix | Delete
$title = __( 'Only letters allowed.', 'et_builder' );
[453] Fix | Delete
break;
[454] Fix | Delete
case 'numbers':
[455] Fix | Delete
$symbols_pattern = '[0-9\s-]';
[456] Fix | Delete
$title = __( 'Only numbers allowed.', 'et_builder' );
[457] Fix | Delete
break;
[458] Fix | Delete
case 'alphanumeric':
[459] Fix | Delete
$symbols_pattern = '[\w\s-]';
[460] Fix | Delete
$title = __( 'Only letters and numbers allowed.', 'et_builder' );
[461] Fix | Delete
break;
[462] Fix | Delete
}
[463] Fix | Delete
}
[464] Fix | Delete
[465] Fix | Delete
if ( 0 !== $min_length && 0 !== $max_length ) {
[466] Fix | Delete
$max_length = max( $min_length, $max_length );
[467] Fix | Delete
$min_length = min( $min_length, $max_length );
[468] Fix | Delete
[469] Fix | Delete
if ( $max_length > 0 ) {
[470] Fix | Delete
$max_length_attr = sprintf(
[471] Fix | Delete
' maxlength="%1$d"',
[472] Fix | Delete
$max_length
[473] Fix | Delete
);
[474] Fix | Delete
}
[475] Fix | Delete
}
[476] Fix | Delete
[477] Fix | Delete
if ( 0 !== $min_length || 0 !== $max_length ) {
[478] Fix | Delete
$length_pattern = '{';
[479] Fix | Delete
[480] Fix | Delete
if ( 0 !== $min_length ) {
[481] Fix | Delete
$length_pattern .= $min_length;
[482] Fix | Delete
$title .= sprintf( __( 'Minimum length: %1$d characters. ', 'et_builder' ), $min_length );
[483] Fix | Delete
}
[484] Fix | Delete
[485] Fix | Delete
if ( 0 === $max_length ) {
[486] Fix | Delete
$length_pattern .= ',';
[487] Fix | Delete
}
[488] Fix | Delete
[489] Fix | Delete
if ( 0 === $min_length ) {
[490] Fix | Delete
$length_pattern .= '0';
[491] Fix | Delete
}
[492] Fix | Delete
[493] Fix | Delete
if ( 0 !== $max_length ) {
[494] Fix | Delete
$length_pattern .= ",{$max_length}";
[495] Fix | Delete
$title .= sprintf( __( 'Maximum length: %1$d characters.', 'et_builder' ), $max_length );
[496] Fix | Delete
}
[497] Fix | Delete
[498] Fix | Delete
$length_pattern .= '}';
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function