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
File: enqueue.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/* Load frontend scripts and styles */
[2] Fix | Delete
add_action( 'wp_enqueue_scripts', 'herald_load_scripts' );
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Load scripts and styles on frontend
[6] Fix | Delete
*
[7] Fix | Delete
* It just wrapps two other separate functions for loading css and js files
[8] Fix | Delete
*
[9] Fix | Delete
* @return void
[10] Fix | Delete
* @since 1.0
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
function herald_load_scripts() {
[14] Fix | Delete
herald_load_css();
[15] Fix | Delete
herald_load_js();
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Load frontend css files
[20] Fix | Delete
*
[21] Fix | Delete
* @return void
[22] Fix | Delete
* @since 1.0
[23] Fix | Delete
*/
[24] Fix | Delete
[25] Fix | Delete
function herald_load_css() {
[26] Fix | Delete
[27] Fix | Delete
//Load google fonts
[28] Fix | Delete
if( $fonts_link = herald_generate_fonts_link() ){
[29] Fix | Delete
wp_enqueue_style( 'herald-fonts', $fonts_link, false, HERALD_THEME_VERSION );
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
[33] Fix | Delete
//Check if is minified option active and load appropriate files
[34] Fix | Delete
if( herald_get_option('minify_css') ){
[35] Fix | Delete
[36] Fix | Delete
wp_enqueue_style( 'herald-main', get_parent_theme_file_uri( '/assets/css/min.css' ), false, HERALD_THEME_VERSION );
[37] Fix | Delete
[38] Fix | Delete
} else {
[39] Fix | Delete
[40] Fix | Delete
$styles = array(
[41] Fix | Delete
'font-awesome' => 'font-awesome.css',
[42] Fix | Delete
'bootstrap' => 'bootstrap.css',
[43] Fix | Delete
'magnific-popup' => 'magnific-popup.css',
[44] Fix | Delete
'owl-carousel' => 'owl.carousel.css',
[45] Fix | Delete
'main' => 'main.css'
[46] Fix | Delete
);
[47] Fix | Delete
[48] Fix | Delete
foreach ($styles as $id => $style ){
[49] Fix | Delete
wp_enqueue_style( 'herald-'.$id, get_parent_theme_file_uri( '/assets/css/' . $style ), false, HERALD_THEME_VERSION );
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
//Append dynamic css
[54] Fix | Delete
wp_add_inline_style( 'herald-main', herald_generate_dynamic_css() );
[55] Fix | Delete
[56] Fix | Delete
//Load WooCommerce CSS
[57] Fix | Delete
if ( herald_is_woocommerce_active() ) {
[58] Fix | Delete
wp_enqueue_style( 'herald-woocommerce', get_parent_theme_file_uri( '/assets/css/herald-woocommerce.css' ), array( 'herald-main'), HERALD_THEME_VERSION );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
//Load bbPress CSS
[62] Fix | Delete
if ( herald_is_bbpress_active() ) {
[63] Fix | Delete
wp_enqueue_style( 'herald-bbpress', get_parent_theme_file_uri( '/assets/css/herald-bbpress.css' ), array( 'herald-main'), HERALD_THEME_VERSION );
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
//Load RTL css
[67] Fix | Delete
if ( herald_is_rtl() ) {
[68] Fix | Delete
wp_enqueue_style( 'herald-rtl', get_parent_theme_file_uri( '/assets/css/rtl.css' ), array( 'herald-main'), HERALD_THEME_VERSION );
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
//Do not load font awesome from our shortcodes plugin
[72] Fix | Delete
wp_dequeue_style( 'mks_shortcodes_fntawsm_css' );
[73] Fix | Delete
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Load frontend js files
[79] Fix | Delete
*
[80] Fix | Delete
* @return void
[81] Fix | Delete
* @since 1.0
[82] Fix | Delete
*/
[83] Fix | Delete
[84] Fix | Delete
function herald_load_js() {
[85] Fix | Delete
[86] Fix | Delete
//Load comment reply js
[87] Fix | Delete
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
[88] Fix | Delete
wp_enqueue_script( 'comment-reply' );
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
//Check if is minified option active and load appropriate files
[92] Fix | Delete
if( herald_get_option('minify_js') ){
[93] Fix | Delete
[94] Fix | Delete
wp_enqueue_script( 'herald-main', get_parent_theme_file_uri( '/assets/js/min.js' ), array( 'jquery', 'imagesloaded' ), HERALD_THEME_VERSION, true );
[95] Fix | Delete
[96] Fix | Delete
} else {
[97] Fix | Delete
[98] Fix | Delete
$scripts = array(
[99] Fix | Delete
'fitvids' => 'jquery.fitvids.js',
[100] Fix | Delete
'magnific-popup' => 'jquery.magnific-popup.js',
[101] Fix | Delete
'sticky-kit' => 'jquery.sticky-kit.js',
[102] Fix | Delete
'owl-carousel' => 'owl.carousel.js',
[103] Fix | Delete
'main' => 'main.js'
[104] Fix | Delete
);
[105] Fix | Delete
[106] Fix | Delete
foreach ($scripts as $id => $script ){
[107] Fix | Delete
wp_enqueue_script( 'herald-'.$id, get_parent_theme_file_uri( '/assets/js/'. $script ), array( 'jquery', 'imagesloaded' ), HERALD_THEME_VERSION, true );
[108] Fix | Delete
}
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
wp_localize_script( 'herald-main', 'herald_js_settings', herald_get_js_settings() );
[112] Fix | Delete
}
[113] Fix | Delete
?>
[114] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function