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