Created
May 24, 2012 15:52
-
-
Save JLeuze/2782356 to your computer and use it in GitHub Desktop.
Plugin to remove JS and CSS for Meteor Slides when not on homepage
This file contains 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: Remove Meteor Scripts | |
Description: Remove JS and CSS for Meteor Slides when not needed. | |
Author: Josh Leuze | |
Author URI: http://www.jleuze.com/ | |
Version: 1.0 */ | |
add_action( 'template_redirect', 'disable_meteorslides_scripts' ); | |
function disable_meteorslides_scripts() { | |
//Removes actions for scripts when not on frontpage, change conditional as needed: http://codex.wordpress.org/Conditional_Tags | |
if ( !is_front_page() ) { | |
remove_action( 'wp_print_scripts', 'meteorslides_javascript' ); | |
remove_action( 'wp_enqueue_scripts', 'meteorslides_css' ); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment