Last active
January 4, 2022 01:45
-
-
Save nosilver4u/40783a3792e296e5af7c876ae5c3f454 to your computer and use it in GitHub Desktop.
Force the inclusion of CSS for certain elements within the Critical CSS function of SWIS Performance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: SWIS Critical CSS Override | |
Version: 1.0.0 | |
*/ | |
add_filter( 'swis_generate_css_post_fields', 'swis_ccss_override_post_fields' ); | |
function swis_ccss_override_post_fields( $fields ) { | |
if ( is_array( $fields ) ) { | |
$fields['forceInclude'] = array( | |
array( 'value' => '.wp-block-embed__wrapper' ), | |
array( 'value' => '.wp-block-cover' ), | |
array( 'value' => '.wp-block-cover-image' ), | |
); | |
} | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment