Actually, I just found the problem was with another piece of code, not the one I posted in my original post!
Any idea why this is happening and how to fix it?
Here's what's causing problems with WP 6.4.3 - Lazy Load wpDiscuz v7 css/js (generic3)
add_action('wp', 'lazy_generic_wpd');
function lazy_generic_wpd() {
if ( is_user_logged_in() ) {return;}
$plugin = "wpdiscuz/class.WpdiscuzCore.php";
include_once(ABSPATH.'wp-admin/includes/plugin.php');
if ( ! function_exists('is_plugin_active') || ! is_plugin_active($plugin) ) {return;}
if ( ! class_exists('mill_LazyLoad') ) { return; }
//if ( isWPRocketNocacheURL() ) { return; }
global $post;
/* if ( ( ! empty($post) && is_a($post, 'WP_Post') && ! has_shortcode( $post->post_content, 'put_wpgm' ) ) ||
! is_singular() ) {
//if ( ( ! has_shortcode( $post->post_content, 'put_wpgm' ) ) ) {
//if ( ! empty($post) && is_a($post, 'WP_Post') && (strpos($post->post_content,'cp_calculatedfieldsf') !== false) ) {
if ( ( ! empty($post) && is_a($post, 'WP_Post') && ! has_shortcode( $post->post_content, 'ctct' ) ) ) {
//remove_action( 'wp_enqueue_scripts', 'wp_review_enqueue', 12 );
//global $CPCFF_FORM;
//global $CPCFF_MAIN;
//remove_action( 'init', array( $CPCFF_FORM::instance(), 'init' ), 1 );
//remove_action( 'init', array( $CPCFF_MAIN::instance(), 'init' ), 1 );
add_action('wp_enqueue_scripts', function(){
wp_deregister_style('ctct_form_styles');
wp_deregister_script('recaptcha-v2');
wp_deregister_script('ctct_frontend_forms');
}, 99999999);
//add_action('wp_footer','start_buff_sdm', 0);
//add_action('wp_footer','end_buff_sdm', 99998); */
//} else {
// 2020-11-06
add_action('wp_footer', function(){
echo "<style>#wpd-bubble-wrapper #wpd-bubble-all-comments-count{color:#1DB99A}#wpd-bubble-wrapper>div{background-color:#1DB99A}</style>";
}, 999);
new mill_LazyLoad (array(
"plugin" => $plugin,
"prefix" => "wpd",
"scrollthreshold" => "444",
"trigger" => array(
"trigger" => 'inview', // 'inview', 'click', null
"loadthreshold" => "2223",
"selector" => '#wpdcom,#wpcomm', // eg '.container'
),
"cssJsArray" => array(
//'\/fancybox\/'
'\/wpdiscuz\/themes\/default\/style\.css',
'\/wpdiscuz\/assets\/third-party\/font-awesome-5\.(.*)\/css\/fa\.min\.css',
'\/wpdiscuz\/assets\/css\/wpdiscuz-combo'
),
"extraJsArray" => [
"/wp-content/plugins/wpdiscuz/assets/js/wpdiscuz-combo-no_quill.min.js",
],
// footer css
"cssArray" => array(
//'\/plugins\/super-socializer\/js\/'
),
"rootMargin" => '1050',
//"fetchJSfilesAsync" => true,
"fetchJSfilesAsync" => false,
));
// }
}