Created
January 29, 2013 21:54
-
-
Save cdils/4668290 to your computer and use it in GitHub Desktop.
If you've got the WP Types & Views plugin installed, you can use the following to clean up excess CSS and script files in the header.
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
// Get rid of WP-Views excess code in header | |
add_action( 'init', 'typeviews_cleanup' ); | |
function typeviews_cleanup() { | |
if ( !is_admin() ) { | |
global $WP_Views; | |
remove_action('wp_print_styles', array($WP_Views, 'add_render_css')); | |
remove_action('wp_head', 'wpv_add_front_end_js'); | |
wp_dequeue_style( 'views-pagination-style' ); | |
wp_dequeue_script( 'views-pagination-script' ); | |
wp_dequeue_script( 'wpv-date-front-end-script' ); | |
wp_dequeue_script( 'jquery-ui-datepicker' ); | |
wp_dequeue_script( 'jquery-ui-core' ); | |
wp_dequeue_style( 'jquery-ui-datepicker' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment