Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckreynolds/247faffa1ad98471621e867afddb530c to your computer and use it in GitHub Desktop.
Save chuckreynolds/247faffa1ad98471621e867afddb530c to your computer and use it in GitHub Desktop.
Simple Social Buttons Plus loads CSS & JS on every page, testing this to start to remove that stuff on anything but is_single()
<?php
/*
* Unregistering Simple Social Buttons Plus plugin test
*/
function XX_deregister_styles() {
if ( ! is_single() ) {
wp_deregister_style( 'ssbp_styles' );
}
}
add_action( 'wp_print_styles', 'XX_deregister_styles', 100 );
function XX_deregister_scripts() {
if ( ! is_single() ) {
wp_deregister_script( 'ssbp_lazy' );
}
}
add_action( 'wp_print_scripts', 'XX_deregister_scripts', 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment