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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/module
File: ContactFormItem.php
}
[500] Fix | Delete
[501] Fix | Delete
if ( '.' !== $symbols_pattern || '*' !== $length_pattern ) {
[502] Fix | Delete
$pattern = sprintf(
[503] Fix | Delete
' pattern="%1$s%2$s"',
[504] Fix | Delete
esc_attr( $symbols_pattern ),
[505] Fix | Delete
esc_attr( $length_pattern )
[506] Fix | Delete
);
[507] Fix | Delete
}
[508] Fix | Delete
[509] Fix | Delete
if ( '' !== $title ) {
[510] Fix | Delete
$title = sprintf(
[511] Fix | Delete
' title="%1$s"',
[512] Fix | Delete
esc_attr( $title )
[513] Fix | Delete
);
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
$conditional_logic_attr = '';
[517] Fix | Delete
[518] Fix | Delete
if ( 'on' === $conditional_logic && ! empty( $conditional_logic_rules ) ) {
[519] Fix | Delete
$option_search = array( '[', ']' );
[520] Fix | Delete
$option_replace = array( '[', ']' );
[521] Fix | Delete
$conditional_logic_rules = str_replace( $option_search, $option_replace, $conditional_logic_rules );
[522] Fix | Delete
$condition_rows = json_decode( $conditional_logic_rules );
[523] Fix | Delete
$ruleset = array();
[524] Fix | Delete
[525] Fix | Delete
foreach ( $condition_rows as $condition_row ) {
[526] Fix | Delete
$condition_value = isset( $condition_row->value ) ? $condition_row->value : '';
[527] Fix | Delete
$condition_value = trim( $condition_value );
[528] Fix | Delete
[529] Fix | Delete
$ruleset[] = array(
[530] Fix | Delete
$condition_row->field,
[531] Fix | Delete
$condition_row->condition,
[532] Fix | Delete
$condition_value,
[533] Fix | Delete
);
[534] Fix | Delete
}
[535] Fix | Delete
[536] Fix | Delete
if ( ! empty( $ruleset ) ) {
[537] Fix | Delete
$json = json_encode( $ruleset );
[538] Fix | Delete
$relation = $conditional_logic_relation === 'off' ? 'any' : 'all';
[539] Fix | Delete
[540] Fix | Delete
$conditional_logic_attr = sprintf(
[541] Fix | Delete
' data-conditional-logic="%1$s" data-conditional-relation="%2$s"',
[542] Fix | Delete
esc_attr( $json ),
[543] Fix | Delete
$relation
[544] Fix | Delete
);
[545] Fix | Delete
}
[546] Fix | Delete
}
[547] Fix | Delete
[548] Fix | Delete
switch( $field_type ) {
[549] Fix | Delete
case 'text':
[550] Fix | Delete
case 'textarea':
[551] Fix | Delete
$input_field = sprintf(
[552] Fix | Delete
'<textarea name="et_pb_contact_%3$s_%2$s" id="et_pb_contact_%3$s_%2$s" class="et_pb_contact_message input" data-required_mark="%6$s" data-field_type="%4$s" data-original_id="%3$s" placeholder="%5$s"%7$s>%1$s</textarea>',
[553] Fix | Delete
( isset( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ? esc_html( sanitize_text_field( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ) : '' ),
[554] Fix | Delete
esc_attr( $current_module_num ),
[555] Fix | Delete
esc_attr( $field_id ),
[556] Fix | Delete
esc_attr( $field_type ),
[557] Fix | Delete
esc_attr( $field_title ),
[558] Fix | Delete
'off' === $required_mark ? 'not_required' : 'required',
[559] Fix | Delete
$multi_view->render_attrs( array(
[560] Fix | Delete
'attrs' => array(
[561] Fix | Delete
'placeholder' => '{{field_title}}',
[562] Fix | Delete
),
[563] Fix | Delete
) )
[564] Fix | Delete
);
[565] Fix | Delete
break;
[566] Fix | Delete
case 'input' :
[567] Fix | Delete
case 'email' :
[568] Fix | Delete
if ( 'email' === $field_type ) {
[569] Fix | Delete
$pattern = '';
[570] Fix | Delete
}
[571] Fix | Delete
[572] Fix | Delete
$input_field = sprintf(
[573] Fix | Delete
'<input type="text" id="et_pb_contact_%3$s_%2$s" class="input" value="%1$s" name="et_pb_contact_%3$s_%2$s" data-required_mark="%6$s" data-field_type="%4$s" data-original_id="%3$s" placeholder="%5$s"%7$s%8$s%9$s%10$s>',
[574] Fix | Delete
( isset( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ? esc_attr( sanitize_text_field( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ) : '' ),
[575] Fix | Delete
esc_attr( $current_module_num ),
[576] Fix | Delete
esc_attr( $field_id ),
[577] Fix | Delete
esc_attr( $field_type ),
[578] Fix | Delete
esc_attr( $field_title ),
[579] Fix | Delete
'off' === $required_mark ? 'not_required' : 'required',
[580] Fix | Delete
$pattern,
[581] Fix | Delete
$title,
[582] Fix | Delete
$max_length_attr,
[583] Fix | Delete
$multi_view->render_attrs( array(
[584] Fix | Delete
'attrs' => array(
[585] Fix | Delete
'placeholder' => '{{field_title}}',
[586] Fix | Delete
),
[587] Fix | Delete
) )
[588] Fix | Delete
);
[589] Fix | Delete
break;
[590] Fix | Delete
case 'checkbox' :
[591] Fix | Delete
$input_field = '';
[592] Fix | Delete
[593] Fix | Delete
if ( ! $checkbox_options ) {
[594] Fix | Delete
$is_checked = ! empty( $checkbox_checked ) && 'on' === $checkbox_checked;
[595] Fix | Delete
$checkbox_options = sprintf(
[596] Fix | Delete
'[{"value":"%1$s","checked":%2$s}]',
[597] Fix | Delete
esc_attr( $field_title ),
[598] Fix | Delete
$is_checked ? 1 : 0
[599] Fix | Delete
);
[600] Fix | Delete
$field_title = '';
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
$option_search = array( '&#91;', '&#93;' );
[604] Fix | Delete
$option_replace = array( '[', ']' );
[605] Fix | Delete
$checkbox_options = str_replace( $option_search, $option_replace, $checkbox_options );
[606] Fix | Delete
$checkbox_options = json_decode( $checkbox_options );
[607] Fix | Delete
[608] Fix | Delete
foreach ( $checkbox_options as $index => $option ) {
[609] Fix | Delete
$is_checked = 1 === $option->checked ? true : false;
[610] Fix | Delete
$option_value = wp_strip_all_tags( $option->value );
[611] Fix | Delete
$drag_id = isset( $option->dragID ) ? $option->dragID : '';
[612] Fix | Delete
$option_id = isset( $option->id ) ? $option->id : $drag_id;
[613] Fix | Delete
$option_id = sprintf( ' data-id="%1$s"', esc_attr( $option_id ) );
[614] Fix | Delete
$option_label = wp_strip_all_tags( $option->value );
[615] Fix | Delete
$option_link = '';
[616] Fix | Delete
[617] Fix | Delete
if ( ! empty( $option->link_url ) ) {
[618] Fix | Delete
$link_text = isset( $option->link_text ) ? $option->link_text : '';
[619] Fix | Delete
$option_link = sprintf( ' <a href="%1$s" target="_blank">%2$s</a>', esc_url( $option->link_url ), esc_html( $link_text ) );
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
// The required field needs a value, use link information if the option value is empty
[623] Fix | Delete
if ( 'off' !== $required_mark && empty( $option_value ) && ! empty( $option_link ) ){
[624] Fix | Delete
$option_value = isset( $option->link_text ) && ! empty( $option->link_text ) ? esc_html( $option->link_text ) : esc_url( $option->link_url );
[625] Fix | Delete
}
[626] Fix | Delete
[627] Fix | Delete
$input_field .= sprintf(
[628] Fix | Delete
'<span class="et_pb_contact_field_checkbox">
[629] Fix | Delete
<input type="checkbox" id="et_pb_contact_%1$s_%5$s_%3$s" class="input" value="%2$s"%4$s%6$s>
[630] Fix | Delete
<label for="et_pb_contact_%1$s_%5$s_%3$s"><i></i>%7$s%8$s</label>
[631] Fix | Delete
</span>',
[632] Fix | Delete
esc_attr( $field_id ),
[633] Fix | Delete
esc_attr( $option_value ),
[634] Fix | Delete
esc_attr( $index ),
[635] Fix | Delete
$is_checked ? ' checked="checked"' : '',
[636] Fix | Delete
esc_attr( $render_count ), // #5
[637] Fix | Delete
$option_id,
[638] Fix | Delete
$option_label,
[639] Fix | Delete
$option_link // #8
[640] Fix | Delete
);
[641] Fix | Delete
}
[642] Fix | Delete
[643] Fix | Delete
$input_field = sprintf(
[644] Fix | Delete
'<input class="et_pb_checkbox_handle" type="hidden" name="et_pb_contact_%1$s_%4$s" data-required_mark="%3$s" data-field_type="%2$s" data-original_id="%1$s">
[645] Fix | Delete
<span class="et_pb_contact_field_options_wrapper">
[646] Fix | Delete
<span class="et_pb_contact_field_options_title"%7$s>%5$s</span>
[647] Fix | Delete
<span class="et_pb_contact_field_options_list">%6$s</span>
[648] Fix | Delete
</span>',
[649] Fix | Delete
esc_attr( $field_id ),
[650] Fix | Delete
esc_attr( $field_type ),
[651] Fix | Delete
'off' === $required_mark ? 'not_required' : 'required',
[652] Fix | Delete
esc_attr( $current_module_num ),
[653] Fix | Delete
esc_html( $field_title ),
[654] Fix | Delete
$input_field,
[655] Fix | Delete
$multi_view->render_attrs( array(
[656] Fix | Delete
'content' => '{{field_title}}',
[657] Fix | Delete
) )
[658] Fix | Delete
);
[659] Fix | Delete
[660] Fix | Delete
break;
[661] Fix | Delete
case 'radio' :
[662] Fix | Delete
$input_field = '';
[663] Fix | Delete
[664] Fix | Delete
if ( $radio_options ) {
[665] Fix | Delete
$option_search = array( '&#91;', '&#93;' );
[666] Fix | Delete
$option_replace = array( '[', ']' );
[667] Fix | Delete
$radio_options = str_replace( $option_search, $option_replace, $radio_options );
[668] Fix | Delete
$radio_options = json_decode( $radio_options );
[669] Fix | Delete
[670] Fix | Delete
foreach ( $radio_options as $index => $option ) {
[671] Fix | Delete
$is_checked = ( isset( $option->checked ) && 1 === $option->checked ) ? true : false;
[672] Fix | Delete
$drag_id = isset( $option->dragID ) ? $option->dragID : '';
[673] Fix | Delete
$option_id = isset( $option->id ) ? $option->id : $drag_id;
[674] Fix | Delete
$option_id = sprintf( ' data-id="%1$s"', esc_attr( $option_id ) );
[675] Fix | Delete
$option_link = '';
[676] Fix | Delete
[677] Fix | Delete
if ( ! empty( $option->link_url ) ) {
[678] Fix | Delete
$link_text = isset( $option->link_text ) ? $option->link_text : '';
[679] Fix | Delete
$option_link = sprintf( ' <a href="%1$s" target="_blank">%2$s</a>', esc_url( $option->link_url ), esc_html( $link_text ) );
[680] Fix | Delete
}
[681] Fix | Delete
[682] Fix | Delete
$input_field .= sprintf(
[683] Fix | Delete
'<span class="et_pb_contact_field_radio">
[684] Fix | Delete
<input type="radio" id="et_pb_contact_%3$s_%2$s_%10$s_%7$s" class="input" value="%8$s" name="et_pb_contact_%3$s_%2$s" data-required_mark="%6$s" data-field_type="%4$s" data-original_id="%3$s" %9$s%11$s>
[685] Fix | Delete
<label for="et_pb_contact_%3$s_%2$s_%10$s_%7$s"><i></i>%8$s%12$s</label>
[686] Fix | Delete
</span>',
[687] Fix | Delete
( isset( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ? esc_attr( sanitize_text_field( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ) : '' ),
[688] Fix | Delete
esc_attr( $current_module_num ),
[689] Fix | Delete
esc_attr( $field_id ),
[690] Fix | Delete
esc_attr( $field_type ),
[691] Fix | Delete
esc_attr( $field_title ), // #5
[692] Fix | Delete
'off' === $required_mark ? 'not_required' : 'required',
[693] Fix | Delete
esc_attr( $index ),
[694] Fix | Delete
esc_attr( wp_strip_all_tags( isset( $option->value ) ? $option->value : '' ) ),
[695] Fix | Delete
checked( $is_checked, true, false ),
[696] Fix | Delete
esc_attr( $render_count ), // #10
[697] Fix | Delete
$option_id,
[698] Fix | Delete
$option_link // #12
[699] Fix | Delete
);
[700] Fix | Delete
}
[701] Fix | Delete
} else {
[702] Fix | Delete
$input_field .= esc_html__( 'No options added.', 'et_builder' );
[703] Fix | Delete
}
[704] Fix | Delete
[705] Fix | Delete
$input_field = sprintf(
[706] Fix | Delete
'<span class="et_pb_contact_field_options_wrapper">
[707] Fix | Delete
<span class="et_pb_contact_field_options_title"%3$s>%1$s</span>
[708] Fix | Delete
<span class="et_pb_contact_field_options_list">%2$s</span>
[709] Fix | Delete
</span>',
[710] Fix | Delete
esc_html( $field_title ),
[711] Fix | Delete
$input_field,
[712] Fix | Delete
$multi_view->render_attrs( array(
[713] Fix | Delete
'content' => '{{field_title}}',
[714] Fix | Delete
) )
[715] Fix | Delete
);
[716] Fix | Delete
[717] Fix | Delete
break;
[718] Fix | Delete
case 'select' :
[719] Fix | Delete
$options = sprintf(
[720] Fix | Delete
'<option value=""%2$s>%1$s</option>',
[721] Fix | Delete
esc_html( $field_title ),
[722] Fix | Delete
$multi_view->render_attrs( array(
[723] Fix | Delete
'content' => '{{field_title}}',
[724] Fix | Delete
) )
[725] Fix | Delete
);
[726] Fix | Delete
[727] Fix | Delete
if ( $select_options ) {
[728] Fix | Delete
$option_search = array( '&#91;', '&#93;' );
[729] Fix | Delete
$option_replace = array( '[', ']' );
[730] Fix | Delete
$select_options = str_replace( $option_search, $option_replace, $select_options );
[731] Fix | Delete
$select_options = json_decode( $select_options );
[732] Fix | Delete
[733] Fix | Delete
foreach ( $select_options as $option ) {
[734] Fix | Delete
$option_id = isset( $option->id ) ? sprintf( ' data-id="%1$s"', esc_attr( $option->id ) ) : '';
[735] Fix | Delete
[736] Fix | Delete
$options .= sprintf(
[737] Fix | Delete
'<option value="%1$s"%3$s>%2$s</option>',
[738] Fix | Delete
esc_attr( wp_strip_all_tags( $option->value ) ),
[739] Fix | Delete
wp_strip_all_tags( $option->value ),
[740] Fix | Delete
$option_id
[741] Fix | Delete
);
[742] Fix | Delete
}
[743] Fix | Delete
}
[744] Fix | Delete
[745] Fix | Delete
$input_field = sprintf(
[746] Fix | Delete
'<select id="et_pb_contact_%3$s_%2$s" class="et_pb_contact_select input" name="et_pb_contact_%3$s_%2$s" data-required_mark="%6$s" data-field_type="%4$s" data-original_id="%3$s">
[747] Fix | Delete
%7$s
[748] Fix | Delete
</select>',
[749] Fix | Delete
( isset( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ? esc_attr( sanitize_text_field( $_POST['et_pb_contact_' . $field_id . '_' . $current_module_num] ) ) : '' ),
[750] Fix | Delete
esc_attr( $current_module_num ),
[751] Fix | Delete
esc_attr( $field_id ),
[752] Fix | Delete
esc_attr( $field_type ),
[753] Fix | Delete
esc_attr( $field_title ),
[754] Fix | Delete
'off' === $required_mark ? 'not_required' : 'required',
[755] Fix | Delete
$options
[756] Fix | Delete
);
[757] Fix | Delete
break;
[758] Fix | Delete
}
[759] Fix | Delete
[760] Fix | Delete
// Module classnames
[761] Fix | Delete
$this->add_classname( array(
[762] Fix | Delete
$this->get_text_orientation_classname(),
[763] Fix | Delete
) );
[764] Fix | Delete
[765] Fix | Delete
if ( 'off' === $fullwidth_field ) {
[766] Fix | Delete
$this->add_classname( 'et_pb_contact_field_half' );
[767] Fix | Delete
}
[768] Fix | Delete
[769] Fix | Delete
if ( 0 === $et_pb_half_width_counter % 2 ) {
[770] Fix | Delete
$this->add_classname( 'et_pb_contact_field_last' );
[771] Fix | Delete
}
[772] Fix | Delete
[773] Fix | Delete
if ( 'on' === self::$_->array_get( $this->props, 'hidden' ) ) {
[774] Fix | Delete
$this->add_classname( 'et_pb_contact_field--hidden' );
[775] Fix | Delete
}
[776] Fix | Delete
[777] Fix | Delete
// Remove automatically added classname
[778] Fix | Delete
$this->remove_classname( 'et_pb_module' );
[779] Fix | Delete
[780] Fix | Delete
$output = sprintf(
[781] Fix | Delete
'<p class="%5$s"%6$s data-id="%3$s" data-type="%7$s">
[782] Fix | Delete
%9$s
[783] Fix | Delete
%8$s
[784] Fix | Delete
<label for="et_pb_contact_%3$s_%2$s" class="et_pb_contact_form_label"%10$s>%1$s</label>
[785] Fix | Delete
%4$s
[786] Fix | Delete
</p>',
[787] Fix | Delete
esc_html( $field_title ),
[788] Fix | Delete
esc_attr( $current_module_num ),
[789] Fix | Delete
esc_attr( $field_id ),
[790] Fix | Delete
$input_field,
[791] Fix | Delete
$this->module_classname( $render_slug ),
[792] Fix | Delete
$conditional_logic_attr,
[793] Fix | Delete
$field_type,
[794] Fix | Delete
$video_background,
[795] Fix | Delete
$parallax_image_background,
[796] Fix | Delete
$multi_view->render_attrs( array(
[797] Fix | Delete
'content' => '{{field_title}}',
[798] Fix | Delete
) )
[799] Fix | Delete
);
[800] Fix | Delete
[801] Fix | Delete
return $output;
[802] Fix | Delete
}
[803] Fix | Delete
}
[804] Fix | Delete
[805] Fix | Delete
new ET_Builder_Module_Contact_Form_Item;
[806] Fix | Delete
[807] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function