Created
May 7, 2013 20:46
-
-
Save FernE97/5535970 to your computer and use it in GitHub Desktop.
PHP: WordPress Remove scripts & styles
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 | |
// Remove Unecessary Styles & Scripts | |
function h5bs_remove_junk() { | |
if ( ! is_admin() ) : | |
global $WP_Views; | |
remove_action( 'wp_print_styles', array( $WP_Views, 'add_render_css' ) ); | |
wp_dequeue_style( 'views-pagination-style' ); // plugins/wp-views/embedded/res/css/wpv-pagination.css | |
wp_dequeue_style( 'date-picker-style' ); // plugins/wp-views/embedded/res/css/datepicker.css | |
wp_dequeue_script( 'views-pagination-script' ); // plugins/wp-views/embedded/res/js/wpv-pagination-embedded.js | |
wp_dequeue_script( 'wpv-date-front-end-script' ); // plugins/wp-views/embedded/res/js/wpv-date-front-end-control.js | |
endif; | |
} | |
add_action( 'init', 'h5bs_remove_junk', 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment