I'am stuck in catching enqueued style. I try to optimize website for PageSpeed. Site use plugin WPBakery Visual Composer
as WYSIWYG editor
. Every block supports Google Fonts, which added with wp_enqueue_style
, but without add_action
, just call wp_enqueue_style
. In my functions.php
, when I try to dequeue this style, to load this font with JS, I don't see this style in list of enqueued styles. I call this code, but I don't see the id in the list
function inspect_styles() {
global $wp_styles;
print_r($wp_styles->queue);
print_r($wp_styles->registered);
}
add_action( 'wp_print_scripts', 'inspect_styles' );
The id of style generated automaticaly - maybe this is the reason?
wp_enqueue_style( 'vc_google_fonts_' . vc_build_safe_css_class( $google_fonts_data['values']['font_family'] ), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets );