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: Search.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Search extends ET_Builder_Module {
[2] Fix | Delete
function init() {
[3] Fix | Delete
$this->name = esc_html__( 'Search', 'et_builder' );
[4] Fix | Delete
$this->plural = esc_html__( 'Searches', 'et_builder' );
[5] Fix | Delete
$this->slug = 'et_pb_search';
[6] Fix | Delete
$this->vb_support = 'on';
[7] Fix | Delete
[8] Fix | Delete
$this->main_css_element = '%%order_class%%';
[9] Fix | Delete
[10] Fix | Delete
$this->settings_modal_toggles = array(
[11] Fix | Delete
'general' => array(
[12] Fix | Delete
'toggles' => array(
[13] Fix | Delete
'main_content' => et_builder_i18n( 'Text' ),
[14] Fix | Delete
'elements' => et_builder_i18n( 'Elements' ),
[15] Fix | Delete
'exceptions' => esc_html__( 'Exceptions', 'et_builder' ),
[16] Fix | Delete
),
[17] Fix | Delete
),
[18] Fix | Delete
'advanced' => array(
[19] Fix | Delete
'toggles' => array(
[20] Fix | Delete
'text' => array(
[21] Fix | Delete
'title' => et_builder_i18n( 'Text' ),
[22] Fix | Delete
'priority' => 49,
[23] Fix | Delete
),
[24] Fix | Delete
'width' => array(
[25] Fix | Delete
'title' => et_builder_i18n( 'Sizing' ),
[26] Fix | Delete
'priority' => 65,
[27] Fix | Delete
),
[28] Fix | Delete
),
[29] Fix | Delete
),
[30] Fix | Delete
);
[31] Fix | Delete
$this->advanced_fields = array(
[32] Fix | Delete
'fonts' => array(
[33] Fix | Delete
'button' => array(
[34] Fix | Delete
'label' => et_builder_i18n( 'Button' ),
[35] Fix | Delete
'css' => array(
[36] Fix | Delete
'main' => "{$this->main_css_element} input.et_pb_searchsubmit",
[37] Fix | Delete
'important' => array( 'line-height', 'text-shadow' ),
[38] Fix | Delete
),
[39] Fix | Delete
'line_height' => array(
[40] Fix | Delete
'default' => '1em',
[41] Fix | Delete
),
[42] Fix | Delete
'font_size' => array(
[43] Fix | Delete
'default' => '14px',
[44] Fix | Delete
),
[45] Fix | Delete
'letter_spacing' => array(
[46] Fix | Delete
'default' => '0px',
[47] Fix | Delete
),
[48] Fix | Delete
'hide_text_align' => true,
[49] Fix | Delete
),
[50] Fix | Delete
),
[51] Fix | Delete
'margin_padding' => array(
[52] Fix | Delete
'css' => array(
[53] Fix | Delete
'padding' => "{$this->main_css_element} input.et_pb_s",
[54] Fix | Delete
'important' => 'all',
[55] Fix | Delete
),
[56] Fix | Delete
'custom_padding' => array(
[57] Fix | Delete
'default' => '0.715em|0.715em|0.715em|0.715em|false|false',
[58] Fix | Delete
),
[59] Fix | Delete
),
[60] Fix | Delete
'background' => array(
[61] Fix | Delete
'css' => array(
[62] Fix | Delete
'main' => "{$this->main_css_element} input.et_pb_s",
[63] Fix | Delete
),
[64] Fix | Delete
),
[65] Fix | Delete
'borders' => array(
[66] Fix | Delete
'default' => array(
[67] Fix | Delete
'css' => array(
[68] Fix | Delete
'main' => array(
[69] Fix | Delete
'border_radii' => "{$this->main_css_element}.et_pb_search, {$this->main_css_element} input.et_pb_s",
[70] Fix | Delete
'border_styles' => "{$this->main_css_element}.et_pb_search",
[71] Fix | Delete
),
[72] Fix | Delete
),
[73] Fix | Delete
'defaults' => array(
[74] Fix | Delete
'border_radii' => 'on|3px|3px|3px|3px',
[75] Fix | Delete
'border_styles' => array(
[76] Fix | Delete
'width' => '1px',
[77] Fix | Delete
'color' => '#dddddd',
[78] Fix | Delete
'style' => 'solid',
[79] Fix | Delete
),
[80] Fix | Delete
),
[81] Fix | Delete
),
[82] Fix | Delete
),
[83] Fix | Delete
'text' => array(
[84] Fix | Delete
'use_background_layout' => true,
[85] Fix | Delete
'css' => array(
[86] Fix | Delete
'main' => "{$this->main_css_element} input.et_pb_searchsubmit, {$this->main_css_element} input.et_pb_s",
[87] Fix | Delete
'text_shadow' => "{$this->main_css_element} input.et_pb_searchsubmit, {$this->main_css_element} input.et_pb_s",
[88] Fix | Delete
),
[89] Fix | Delete
'text_orientation' => array(
[90] Fix | Delete
'exclude_options' => array( 'justified' ),
[91] Fix | Delete
),
[92] Fix | Delete
'options' => array(
[93] Fix | Delete
'text_orientation' => array(
[94] Fix | Delete
'default' => 'left',
[95] Fix | Delete
),
[96] Fix | Delete
'background_layout' => array(
[97] Fix | Delete
'default' => 'light',
[98] Fix | Delete
'hover' => 'tabs',
[99] Fix | Delete
),
[100] Fix | Delete
),
[101] Fix | Delete
),
[102] Fix | Delete
'button' => false,
[103] Fix | Delete
'link_options' => false,
[104] Fix | Delete
'form_field' => array(
[105] Fix | Delete
'form_field' => array(
[106] Fix | Delete
'label' => esc_html__( 'Field', 'et_builder' ),
[107] Fix | Delete
'css' => array(
[108] Fix | Delete
'main' => '%%order_class%% form input.et_pb_s',
[109] Fix | Delete
'hover' => '%%order_class%% form input.et_pb_s:hover',
[110] Fix | Delete
'focus' => '%%order_class%% form input.et_pb_s:focus',
[111] Fix | Delete
'focus_hover' => '%%order_class%% form input.et_pb_s:focus:hover',
[112] Fix | Delete
),
[113] Fix | Delete
'placeholder' => false,
[114] Fix | Delete
'margin_padding' => false,
[115] Fix | Delete
'box_shadow' => false,
[116] Fix | Delete
'border_styles' => false,
[117] Fix | Delete
'font_field' => array(
[118] Fix | Delete
'css' => array(
[119] Fix | Delete
'main' => implode(', ', array(
[120] Fix | Delete
'%%order_class%% form input.et_pb_s',
[121] Fix | Delete
'%%order_class%% form input.et_pb_s::placeholder',
[122] Fix | Delete
'%%order_class%% form input.et_pb_s::-webkit-input-placeholder',
[123] Fix | Delete
'%%order_class%% form input.et_pb_s::-ms-input-placeholder',
[124] Fix | Delete
'%%order_class%% form input.et_pb_s::-moz-placeholder',
[125] Fix | Delete
) ),
[126] Fix | Delete
'placeholder' => true,
[127] Fix | Delete
'important' => array( 'line-height', 'text-shadow' ),
[128] Fix | Delete
),
[129] Fix | Delete
'line_height' => array(
[130] Fix | Delete
'default' => '1em',
[131] Fix | Delete
),
[132] Fix | Delete
'font_size' => array(
[133] Fix | Delete
'default' => '14px',
[134] Fix | Delete
),
[135] Fix | Delete
'letter_spacing' => array(
[136] Fix | Delete
'default' => '0px',
[137] Fix | Delete
),
[138] Fix | Delete
),
[139] Fix | Delete
),
[140] Fix | Delete
),
[141] Fix | Delete
'overflow'=>array(
[142] Fix | Delete
'default' =>'hidden',
[143] Fix | Delete
),
[144] Fix | Delete
);
[145] Fix | Delete
[146] Fix | Delete
$this->custom_css_fields = array(
[147] Fix | Delete
'input_field' => array(
[148] Fix | Delete
'label' => esc_html__( 'Input Field', 'et_builder' ),
[149] Fix | Delete
'selector' => 'input.et_pb_s',
[150] Fix | Delete
),
[151] Fix | Delete
'button' => array(
[152] Fix | Delete
'label' => et_builder_i18n( 'Button' ),
[153] Fix | Delete
'selector' => 'input.et_pb_searchsubmit',
[154] Fix | Delete
),
[155] Fix | Delete
);
[156] Fix | Delete
[157] Fix | Delete
$this->help_videos = array(
[158] Fix | Delete
array(
[159] Fix | Delete
'id' => 'HNmb20Mdvno',
[160] Fix | Delete
'name' => esc_html__( 'An introduction to the Search module', 'et_builder' ),
[161] Fix | Delete
),
[162] Fix | Delete
);
[163] Fix | Delete
}
[164] Fix | Delete
[165] Fix | Delete
function get_fields() {
[166] Fix | Delete
$fields = array(
[167] Fix | Delete
'exclude_pages' => array(
[168] Fix | Delete
'label' => esc_html__( 'Exclude Pages', 'et_builder' ),
[169] Fix | Delete
'type' => 'yes_no_button',
[170] Fix | Delete
'option_category' => 'configuration',
[171] Fix | Delete
'options' => array(
[172] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[173] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[174] Fix | Delete
),
[175] Fix | Delete
'description' => esc_html__( 'Turning this on will exclude Pages from search results', 'et_builder' ),
[176] Fix | Delete
'toggle_slug' => 'exceptions',
[177] Fix | Delete
),
[178] Fix | Delete
'exclude_posts' => array(
[179] Fix | Delete
'label' => esc_html__( 'Exclude Posts', 'et_builder' ),
[180] Fix | Delete
'type' => 'yes_no_button',
[181] Fix | Delete
'option_category' => 'configuration',
[182] Fix | Delete
'options' => array(
[183] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[184] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[185] Fix | Delete
),
[186] Fix | Delete
'default' => 'off',
[187] Fix | Delete
'affects' => array(
[188] Fix | Delete
'include_categories',
[189] Fix | Delete
),
[190] Fix | Delete
'description' => esc_html__( 'Turning this on will exclude Posts from search results', 'et_builder' ),
[191] Fix | Delete
'toggle_slug' => 'exceptions',
[192] Fix | Delete
),
[193] Fix | Delete
'include_categories' => array(
[194] Fix | Delete
'label' => esc_html__( 'Exclude Categories', 'et_builder' ),
[195] Fix | Delete
'type' => 'categories',
[196] Fix | Delete
'option_category' => 'basic_option',
[197] Fix | Delete
'renderer_options' => array(
[198] Fix | Delete
'use_terms' => false,
[199] Fix | Delete
),
[200] Fix | Delete
'depends_show_if' => 'off',
[201] Fix | Delete
'description' => esc_html__( 'Choose which categories you would like to exclude from the search results.', 'et_builder' ),
[202] Fix | Delete
'toggle_slug' => 'exceptions',
[203] Fix | Delete
),
[204] Fix | Delete
'show_button' => array(
[205] Fix | Delete
'label' => esc_html__( 'Show Button', 'et_builder' ),
[206] Fix | Delete
'type' => 'yes_no_button',
[207] Fix | Delete
'option_category' => 'configuration',
[208] Fix | Delete
'options' => array(
[209] Fix | Delete
'on' => et_builder_i18n( 'Yes' ),
[210] Fix | Delete
'off' => et_builder_i18n( 'No' ),
[211] Fix | Delete
),
[212] Fix | Delete
'default' => 'on',
[213] Fix | Delete
'toggle_slug' => 'elements',
[214] Fix | Delete
'description' => esc_html__( 'Turn this on to show the Search button', 'et_builder' ),
[215] Fix | Delete
'mobile_options' => true,
[216] Fix | Delete
'hover' => 'tabs',
[217] Fix | Delete
),
[218] Fix | Delete
'placeholder' => array(
[219] Fix | Delete
'label' => esc_html__( 'Input Placeholder', 'et_builder' ),
[220] Fix | Delete
'type' => 'text',
[221] Fix | Delete
'description' => esc_html__( 'Type the text you want to use as placeholder for the search field.', 'et_builder' ),
[222] Fix | Delete
'toggle_slug' => 'main_content',
[223] Fix | Delete
'dynamic_content' => 'text',
[224] Fix | Delete
'mobile_options' => true,
[225] Fix | Delete
'hover' => 'tabs',
[226] Fix | Delete
),
[227] Fix | Delete
'button_color' => array(
[228] Fix | Delete
'label' => esc_html__( 'Button and Border Color', 'et_builder' ),
[229] Fix | Delete
'type' => 'color-alpha',
[230] Fix | Delete
'custom_color' => true,
[231] Fix | Delete
'tab_slug' => 'advanced',
[232] Fix | Delete
'toggle_slug' => 'button',
[233] Fix | Delete
'hover' => 'tabs',
[234] Fix | Delete
'mobile_options' => true,
[235] Fix | Delete
),
[236] Fix | Delete
'placeholder_color' => array(
[237] Fix | Delete
'label' => esc_html__( 'Placeholder Color', 'et_builder' ),
[238] Fix | Delete
'description' => esc_html__( 'Pick a color to be used for the placeholder written inside input fields.', 'et_builder' ),
[239] Fix | Delete
'type' => 'color-alpha',
[240] Fix | Delete
'custom_color' => true,
[241] Fix | Delete
'tab_slug' => 'advanced',
[242] Fix | Delete
'toggle_slug' => 'form_field',
[243] Fix | Delete
'hover' => 'tabs',
[244] Fix | Delete
'mobile_options' => true,
[245] Fix | Delete
),
[246] Fix | Delete
);
[247] Fix | Delete
[248] Fix | Delete
return $fields;
[249] Fix | Delete
}
[250] Fix | Delete
[251] Fix | Delete
public function get_transition_fields_css_props() {
[252] Fix | Delete
$fields = parent::get_transition_fields_css_props();
[253] Fix | Delete
[254] Fix | Delete
$fields['placeholder_color'] = array('color' => array(
[255] Fix | Delete
'%%order_class%% form input.et_pb_s::placeholder',
[256] Fix | Delete
'%%order_class%% form input.et_pb_s::-webkit-input-placeholder',
[257] Fix | Delete
'%%order_class%% form input.et_pb_s::-ms-input-placeholder',
[258] Fix | Delete
'%%order_class%% form input.et_pb_s::-moz-placeholder',
[259] Fix | Delete
));
[260] Fix | Delete
[261] Fix | Delete
return $fields;
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
function render( $attrs, $content = null, $render_slug ) {
[265] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[266] Fix | Delete
$exclude_categories = $this->props['include_categories'];
[267] Fix | Delete
$exclude_posts = $this->props['exclude_posts'];
[268] Fix | Delete
$exclude_pages = $this->props['exclude_pages'];
[269] Fix | Delete
$show_button = $this->props['show_button'];
[270] Fix | Delete
$placeholder = $multi_view->render_element( array(
[271] Fix | Delete
'tag' => 'input',
[272] Fix | Delete
'attrs' => array(
[273] Fix | Delete
'type' => 'text',
[274] Fix | Delete
'name' => 's',
[275] Fix | Delete
'class' => 'et_pb_s',
[276] Fix | Delete
'placeholder' => '{{placeholder}}',
[277] Fix | Delete
),
[278] Fix | Delete
) );
[279] Fix | Delete
$input_line_height = $this->props['form_field_line_height'];
[280] Fix | Delete
$button_color_hover = $this->get_hover_value( 'button_color' );
[281] Fix | Delete
$button_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'button_color' );
[282] Fix | Delete
$placeholder_color_hover = $this->get_hover_value( 'placeholder_color' );
[283] Fix | Delete
$placeholder_color_values = et_pb_responsive_options()->get_property_values( $this->props, 'placeholder_color' );
[284] Fix | Delete
[285] Fix | Delete
$video_background = $this->video_background();
[286] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[287] Fix | Delete
[288] Fix | Delete
$this->content = et_builder_replace_code_content_entities( $this->content );
[289] Fix | Delete
[290] Fix | Delete
// Button Color.
[291] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $button_color_values, '%%order_class%% input.et_pb_searchsubmit', array( 'background-color', 'border-color' ), $render_slug, ' !important;', 'color' );
[292] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $button_color_values, '%%order_class%% input.et_pb_s', 'border-color', $render_slug, ' !important;', 'color' );
[293] Fix | Delete
[294] Fix | Delete
if ( et_builder_is_hover_enabled( 'button_color', $this->props ) ) {
[295] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[296] Fix | Delete
'selector' => '%%order_class%% input.et_pb_searchsubmit:hover',
[297] Fix | Delete
'declaration' => sprintf(
[298] Fix | Delete
'background: %1$s !important;border-color:%1$s !important;',
[299] Fix | Delete
esc_html( $button_color_hover )
[300] Fix | Delete
),
[301] Fix | Delete
) );
[302] Fix | Delete
[303] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[304] Fix | Delete
'selector' => '%%order_class%% input.et_pb_s:hover',
[305] Fix | Delete
'declaration' => sprintf(
[306] Fix | Delete
'border-color:%1$s !important;',
[307] Fix | Delete
esc_html( $button_color_hover )
[308] Fix | Delete
),
[309] Fix | Delete
) );
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
// Placeholder Color.
[313] Fix | Delete
$placeholder_selectors = array(
[314] Fix | Delete
'%%order_class%% form input.et_pb_s::-webkit-input-placeholder',
[315] Fix | Delete
'%%order_class%% form input.et_pb_s::-moz-placeholder',
[316] Fix | Delete
'%%order_class%% form input.et_pb_s:-ms-input-placeholder',
[317] Fix | Delete
);
[318] Fix | Delete
[319] Fix | Delete
et_pb_responsive_options()->generate_responsive_css( $placeholder_color_values, join( ', ', $placeholder_selectors ), 'color', $render_slug, ' !important;', 'color' );
[320] Fix | Delete
[321] Fix | Delete
if ( et_builder_is_hover_enabled( 'placeholder_color', $this->props ) ) {
[322] Fix | Delete
$placeholder_selectors = array(
[323] Fix | Delete
'%%order_class%% form input.et_pb_s:hover::-webkit-input-placeholder',
[324] Fix | Delete
'%%order_class%% form input.et_pb_s:hover::-moz-placeholder',
[325] Fix | Delete
'%%order_class%% form input.et_pb_s:hover:-ms-input-placeholder',
[326] Fix | Delete
);
[327] Fix | Delete
[328] Fix | Delete
foreach ( $placeholder_selectors as $single_selector ) {
[329] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[330] Fix | Delete
'selector' => $single_selector,
[331] Fix | Delete
'declaration' => sprintf(
[332] Fix | Delete
'color: %1$s !important;',
[333] Fix | Delete
esc_html( $placeholder_color_hover )
[334] Fix | Delete
),
[335] Fix | Delete
) );
[336] Fix | Delete
}
[337] Fix | Delete
}
[338] Fix | Delete
[339] Fix | Delete
if ( '' !== $input_line_height ) {
[340] Fix | Delete
ET_Builder_Element::set_style( $render_slug, array(
[341] Fix | Delete
'selector' => '%%order_class%% input.et_pb_s',
[342] Fix | Delete
'declaration' => 'height: auto; min-height: 0;',
[343] Fix | Delete
) );
[344] Fix | Delete
}
[345] Fix | Delete
[346] Fix | Delete
// Module classnames
[347] Fix | Delete
$this->add_classname( array(
[348] Fix | Delete
$this->get_text_orientation_classname( true ),
[349] Fix | Delete
) );
[350] Fix | Delete
[351] Fix | Delete
// Background layout class names.
[352] Fix | Delete
$background_layout_class_names = et_pb_background_layout_options()->get_background_layout_class( $this->props );
[353] Fix | Delete
$this->add_classname( $background_layout_class_names );
[354] Fix | Delete
[355] Fix | Delete
if ( 'on' !== $show_button ) {
[356] Fix | Delete
$this->add_classname( 'et_pb_hide_search_button' );
[357] Fix | Delete
}
[358] Fix | Delete
[359] Fix | Delete
// Background layout data attributes.
[360] Fix | Delete
$data_background_layout = et_pb_background_layout_options()->get_background_layout_attrs( $this->props );
[361] Fix | Delete
[362] Fix | Delete
$multi_view_show_button_data_attr = $multi_view->render_attrs( array(
[363] Fix | Delete
'classes' => array(
[364] Fix | Delete
'et_pb_hide_search_button' => array(
[365] Fix | Delete
'show_button' => 'off',
[366] Fix | Delete
),
[367] Fix | Delete
),
[368] Fix | Delete
) );
[369] Fix | Delete
[370] Fix | Delete
$output = sprintf(
[371] Fix | Delete
'<div%3$s class="%2$s"%12$s%13$s>
[372] Fix | Delete
%11$s
[373] Fix | Delete
%10$s
[374] Fix | Delete
<form role="search" method="get" class="et_pb_searchform" action="%1$s">
[375] Fix | Delete
<div>
[376] Fix | Delete
<label class="screen-reader-text" for="s">%8$s</label>
[377] Fix | Delete
%7$s
[378] Fix | Delete
<input type="hidden" name="et_pb_searchform_submit" value="et_search_proccess" />
[379] Fix | Delete
%4$s
[380] Fix | Delete
%5$s
[381] Fix | Delete
%6$s
[382] Fix | Delete
<input type="submit" value="%9$s" class="et_pb_searchsubmit">
[383] Fix | Delete
</div>
[384] Fix | Delete
</form>
[385] Fix | Delete
</div> <!-- .et_pb_text -->',
[386] Fix | Delete
esc_url( home_url( '/' ) ),
[387] Fix | Delete
$this->module_classname( $render_slug ),
[388] Fix | Delete
$this->module_id(),
[389] Fix | Delete
'' !== $exclude_categories ? sprintf( '<input type="hidden" name="et_pb_search_cat" value="%1$s" />', esc_attr( $exclude_categories ) ) : '',
[390] Fix | Delete
'on' !== $exclude_posts ? '<input type="hidden" name="et_pb_include_posts" value="yes" />' : '', // #5
[391] Fix | Delete
'on' !== $exclude_pages ? '<input type="hidden" name="et_pb_include_pages" value="yes" />' : '',
[392] Fix | Delete
$placeholder,
[393] Fix | Delete
esc_html__( 'Search for:', 'et_builder' ),
[394] Fix | Delete
esc_attr__( 'Search', 'et_builder' ),
[395] Fix | Delete
$video_background, // #10
[396] Fix | Delete
$parallax_image_background,
[397] Fix | Delete
et_core_esc_previously( $data_background_layout ),
[398] Fix | Delete
$multi_view_show_button_data_attr
[399] Fix | Delete
);
[400] Fix | Delete
[401] Fix | Delete
return $output;
[402] Fix | Delete
}
[403] Fix | Delete
}
[404] Fix | Delete
[405] Fix | Delete
new ET_Builder_Module_Search;
[406] Fix | Delete
[407] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function