Created
January 19, 2013 11:16
-
-
Save rosshanney/4572127 to your computer and use it in GitHub Desktop.
Replace theme jQuery UI with WP version
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: Replace theme jQuery UI with WP version | |
*/ | |
function gce_remove_truethemes_jquery_ui() { | |
if ( ! is_admin() ) | |
wp_deregister_script( 'jquery-ui' ); | |
} | |
add_action( 'template_redirect', 'gce_remove_truethemes_jquery_ui', 91 ); | |
function gce_use_wp_jquery_ui() { | |
wp_enqueue_script( 'jquery-ui-core' ); | |
wp_enqueue_script( 'jquery-ui-widget' ); | |
wp_enqueue_script( 'jquery-ui-accordion' ); | |
wp_enqueue_script( 'jquery-ui-tabs' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'gce_use_wp_jquery_ui' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment