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/herald/core/admin
File: ajax.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/* Update latest theme version (we use internally for new version introduction text) */
[2] Fix | Delete
[3] Fix | Delete
add_action('wp_ajax_herald_update_version', 'herald_update_version');
[4] Fix | Delete
[5] Fix | Delete
if(!function_exists('herald_update_version')):
[6] Fix | Delete
function herald_update_version(){
[7] Fix | Delete
update_option('herald_theme_version',HERALD_THEME_VERSION);
[8] Fix | Delete
die();
[9] Fix | Delete
}
[10] Fix | Delete
endif;
[11] Fix | Delete
[12] Fix | Delete
[13] Fix | Delete
/* Hide welcome screen */
[14] Fix | Delete
[15] Fix | Delete
add_action('wp_ajax_herald_hide_welcome', 'herald_hide_welcome');
[16] Fix | Delete
[17] Fix | Delete
if(!function_exists('herald_hide_welcome')):
[18] Fix | Delete
function herald_hide_welcome(){
[19] Fix | Delete
update_option('herald_welcome_box_displayed', true);
[20] Fix | Delete
die();
[21] Fix | Delete
}
[22] Fix | Delete
endif;
[23] Fix | Delete
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* Get searched posts or pages on ajax call for auto-complete functionality
[27] Fix | Delete
*
[28] Fix | Delete
*/
[29] Fix | Delete
add_action( 'wp_ajax_herald_ajax_search', 'herald_ajax_search' );
[30] Fix | Delete
[31] Fix | Delete
if ( !function_exists( 'herald_ajax_search' ) ):
[32] Fix | Delete
function herald_ajax_search() {
[33] Fix | Delete
[34] Fix | Delete
$post_type = in_array($_GET['type'], array('posts', 'featured')) ? array_keys( get_post_types( array( 'public' => true ) ) ) : $_GET['type'];
[35] Fix | Delete
[36] Fix | Delete
$posts = get_posts( array(
[37] Fix | Delete
's' => $_GET['term'],
[38] Fix | Delete
'post_type' => $post_type,
[39] Fix | Delete
'posts_per_page' => -1
[40] Fix | Delete
) );
[41] Fix | Delete
[42] Fix | Delete
$suggestions = array();
[43] Fix | Delete
[44] Fix | Delete
global $post;
[45] Fix | Delete
[46] Fix | Delete
foreach ( $posts as $post ) {
[47] Fix | Delete
setup_postdata( $post );
[48] Fix | Delete
$suggestion = array();
[49] Fix | Delete
$suggestion['label'] = esc_html( $post->post_title );
[50] Fix | Delete
$suggestion['id'] = $post->ID;
[51] Fix | Delete
$suggestions[]= $suggestion;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
$response = $_GET["callback"] . "(" . json_encode( $suggestions ) . ")";
[55] Fix | Delete
[56] Fix | Delete
echo wp_kses_post( $response );
[57] Fix | Delete
[58] Fix | Delete
die();
[59] Fix | Delete
}
[60] Fix | Delete
endif;
[61] Fix | Delete
[62] Fix | Delete
?>
[63] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function