Changeset 695650
- Timestamp:
- 04/11/2013 03:31:04 AM (13 years ago)
- Location:
- wp-jquery-plus/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-jquery-plus.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-jquery-plus/trunk/readme.txt
r680232 r695650 3 3 Tags: jquery,google 4 4 Requires at least: 3.5 5 Tested up to: 3. 5.16 Stable tag: 0. 4.25 Tested up to: 3.6-beta1 6 Stable tag: 0.5 7 7 License: GPLv2 8 8 … … 28 28 == Changelog == 29 29 30 = 0.5 = 31 * Added 3.6 check (since the jQuery handle was changed) and updated accordingly to work in both 3.5 and 3.6. 32 30 33 = 0.4.2 = 31 34 * Source credits given for local fallback -
wp-jquery-plus/trunk/wp-jquery-plus.php
r680232 r695650 6 6 Author: Zach Schnackel 7 7 Author URI: http://zslabs.com 8 Version: 0. 4.28 Version: 0.5 9 9 */ 10 10 … … 37 37 function wpjp_set_src() { 38 38 39 global $wp_version; 40 39 41 if ( !is_admin() ) { 40 42 41 // Get current version of jQuery from WordPress core42 $wp_jquery_ver = $GLOBALS['wp_scripts']->registered['jquery']->ver;43 // Check to see if we're on 3.6 or newer (changed the jQuery handle) 44 if ( version_compare( $wp_version, '3.6-alpha1', '>=' ) ) { 43 45 44 // Set jQuery Google URL45 $jquery_google_url = '//ajax.googleapis.com/ajax/libs/jquery/'.$wp_jquery_ver.'/jquery.min.js';46 // Get current version of jQuery from WordPress core 47 $wp_jquery_ver = $GLOBALS['wp_scripts']->registered['jquery-core']->ver; 46 48 47 // De-register jQuery48 wp_deregister_script( 'jquery' );49 // Set jQuery Google URL 50 $jquery_google_url = '//ajax.googleapis.com/ajax/libs/jquery/'.$wp_jquery_ver.'/jquery.min.js'; 49 51 50 // Register jQuery with Google URL 51 wp_register_script( 'jquery', $jquery_google_url, '', null, false ); 52 // De-register jQuery 53 wp_deregister_script( 'jquery-core' ); 54 55 // Register jQuery with Google URL 56 wp_register_script( 'jquery-core', $jquery_google_url, '', null, false ); 57 58 } 59 // Theeen we're on 3.5 (since the plugin will deactivate if any lower) 60 else { 61 62 // Get current version of jQuery from WordPress core 63 $wp_jquery_ver = $GLOBALS['wp_scripts']->registered['jquery']->ver; 64 65 // Set jQuery Google URL 66 $jquery_google_url = '//ajax.googleapis.com/ajax/libs/jquery/'.$wp_jquery_ver.'/jquery.min.js'; 67 68 // De-register jQuery 69 wp_deregister_script( 'jquery' ); 70 71 // Register jQuery with Google URL 72 wp_register_script( 'jquery', $jquery_google_url, '', null, false ); 73 74 } 52 75 53 76 } … … 65 88 function wpjp_local_fallback( $src, $handle ) { 66 89 90 global $wp_version; 91 67 92 if ( !is_admin() ) { 68 93 … … 74 99 } 75 100 76 if ( $handle === 'jquery' ) { 77 $add_jquery_fallback = true; 101 // Check to see what version we're using (so we can use the appropriate handle) 102 if ( version_compare( $wp_version, '3.6-alpha1', '>=' ) ) { 103 104 if ( $handle === 'jquery-core' ) { 105 $add_jquery_fallback = true; 106 } 107 78 108 } 109 else { 110 111 if ( $handle === 'jquery' ) { 112 $add_jquery_fallback = true; 113 } 114 } 115 79 116 80 117 return $src;
Note: See TracChangeset
for help on using the changeset viewer.