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.../plugins/accelera.../template...
File: search-functions.php
<?php
[0] Fix | Delete
// Exit if accessed directly
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit;
[3] Fix | Delete
}
[4] Fix | Delete
// 46. search search search everywhere #615
[5] Fix | Delete
add_action('pre_amp_render_post','ampforwp_search_related_functions',12);
[6] Fix | Delete
function ampforwp_search_related_functions(){
[7] Fix | Delete
global $redux_builder_amp;
[8] Fix | Delete
if ( $redux_builder_amp['amp-design-selector'] == 1 ||
[9] Fix | Delete
$redux_builder_amp['amp-design-selector'] == 2 ||
[10] Fix | Delete
$redux_builder_amp['amp-design-selector'] == 3 ) {
[11] Fix | Delete
[12] Fix | Delete
add_filter( 'ampforwp_post_template_data', 'ampforwp_add_lightbox_and_form_scripts');
[13] Fix | Delete
add_action('ampforwp_search_form','ampforwp_the_search_form');
[14] Fix | Delete
}
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
add_action('ampforwp_global_after_footer','ampforwp_lightbox_html_output');
[18] Fix | Delete
function ampforwp_lightbox_html_output() {
[19] Fix | Delete
if ( is_search_enabled_in_ampforwp() ) {
[20] Fix | Delete
global $redux_builder_amp;
[21] Fix | Delete
if( $redux_builder_amp['amp-design-1-search-feature'] ||
[22] Fix | Delete
$redux_builder_amp['amp-design-2-search-feature'] ||
[23] Fix | Delete
$redux_builder_amp['amp-design-3-search-feature'] ) { ?>
[24] Fix | Delete
[25] Fix | Delete
<amp-lightbox id="search-icon" layout="nodisplay">
[26] Fix | Delete
<?php do_action('ampforwp_search_form'); ?>
[27] Fix | Delete
<button on="tap:search-icon.close" class="closebutton">X</button>
[28] Fix | Delete
<i class="icono-cross"></i>
[29] Fix | Delete
</amp-lightbox>
[30] Fix | Delete
<?php }
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
add_action( 'ampforwp_header_search' , 'ampforwp_search_button_html_output' );
[35] Fix | Delete
function ampforwp_search_button_html_output(){
[36] Fix | Delete
if ( is_search_enabled_in_ampforwp() ) {
[37] Fix | Delete
global $redux_builder_amp;
[38] Fix | Delete
if( $redux_builder_amp['amp-design-1-search-feature'] ||
[39] Fix | Delete
$redux_builder_amp['amp-design-2-search-feature'] ||
[40] Fix | Delete
$redux_builder_amp['amp-design-3-search-feature'] ) { ?>
[41] Fix | Delete
<div class="searchmenu">
[42] Fix | Delete
<button on="tap:search-icon" aria-label="Search">
[43] Fix | Delete
<i class="icono-search"></i>
[44] Fix | Delete
</button>
[45] Fix | Delete
</div>
[46] Fix | Delete
<?php }
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
function ampforwp_add_lightbox_and_form_scripts( $data ) {
[51] Fix | Delete
if ( is_search_enabled_in_ampforwp() ) {
[52] Fix | Delete
global $redux_builder_amp;
[53] Fix | Delete
// Add Scripts only when Search is Enabled
[54] Fix | Delete
if( $redux_builder_amp['amp-design-1-search-feature'] ||
[55] Fix | Delete
$redux_builder_amp['amp-design-2-search-feature'] ||
[56] Fix | Delete
$redux_builder_amp['amp-design-3-search-feature'] ) {
[57] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-lightbox'] ) ) {
[58] Fix | Delete
$data['amp_component_scripts']['amp-lightbox'] = 'https://cdn.ampproject.org/v0/amp-lightbox-0.1.js';
[59] Fix | Delete
}
[60] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-form'] ) ) {
[61] Fix | Delete
$data['amp_component_scripts']['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js';
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
}
[65] Fix | Delete
return $data;
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
function ampforwp_the_search_form() {
[69] Fix | Delete
echo ampforwp_get_search_form();
[70] Fix | Delete
}
[71] Fix | Delete
function ampforwp_get_search_form() {
[72] Fix | Delete
if ( is_search_enabled_in_ampforwp() ) {
[73] Fix | Delete
global $redux_builder_amp;
[74] Fix | Delete
$action_url = '';
[75] Fix | Delete
$amp_query_variable = '';
[76] Fix | Delete
$amp_query_variable_val = '';
[77] Fix | Delete
$label = esc_html__(ampforwp_translation(ampforwp_get_setting('ampforwp-search-label'), 'Type your search query and hit enter'));
[78] Fix | Delete
$action_url = esc_url( get_bloginfo('url') );
[79] Fix | Delete
$action_url = preg_replace('#^http?:#', '', $action_url);
[80] Fix | Delete
$placeholder = ampforwp_translation($redux_builder_amp['ampforwp-search-placeholder'], 'Type Here' );
[81] Fix | Delete
$value = get_search_query();
[82] Fix | Delete
$name = 's';
[83] Fix | Delete
$mob_pres_link = false;
[84] Fix | Delete
if(function_exists('ampforwp_mobile_redirect_preseve_link')){
[85] Fix | Delete
$mob_pres_link = ampforwp_mobile_redirect_preseve_link();
[86] Fix | Delete
}
[87] Fix | Delete
if ( ampforwp_get_setting('ampforwp-amp-takeover') == false && $mob_pres_link == false) {
[88] Fix | Delete
$amp_query_variable = 'amp';
[89] Fix | Delete
$amp_query_variable_val = '1';
[90] Fix | Delete
}
[91] Fix | Delete
if (ampforwp_get_setting('ampforwp-search-google')) {
[92] Fix | Delete
$action_url = 'https://www.google.com/search';
[93] Fix | Delete
$amp_query_variable = '';
[94] Fix | Delete
$value = 'site:'.get_bloginfo('url').$value;
[95] Fix | Delete
$name = 'q';
[96] Fix | Delete
}
[97] Fix | Delete
$form = '<form role="search" method="get" id="searchform" class="searchform" target="_top" action="' . esc_url($action_url) .'">
[98] Fix | Delete
<div>
[99] Fix | Delete
<label aria-label="Type your query" class="screen-reader-text" for="s">' . esc_html__($label,'accelerated-mobile-pages') . '</label>
[100] Fix | Delete
<input type="text" placeholder="AMP" value="'.esc_attr($amp_query_variable_val).'" name="'.esc_attr($amp_query_variable).'" class="hide" id="ampforwp_search_query_item" />
[101] Fix | Delete
<input type="text" placeholder="'.esc_attr($placeholder).'" value="' . esc_attr($value).'" name="'.esc_attr($name).'" id="s" />
[102] Fix | Delete
<label aria-label="Submit amp search" for="amp-search-submit" >
[103] Fix | Delete
<input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
[104] Fix | Delete
</label>
[105] Fix | Delete
</div>
[106] Fix | Delete
</form>';
[107] Fix | Delete
return $form;
[108] Fix | Delete
}
[109] Fix | Delete
}
[110] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function