Changeset 2352763
- Timestamp:
- 08/05/2020 12:05:29 AM (5 years ago)
- Location:
- native-performance/trunk
- Files:
-
- 3 edited
-
core/class-functions.php (modified) (1 diff)
-
includes/tweaks/footer.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
native-performance/trunk/core/class-functions.php
r2186154 r2352763 92 92 // Include/tweaks/footer 93 93 if(native_performance_active('footer')){ 94 add_filter(' script_loader_tag', 'native_performance_defer_parsing_of_js',10,2);94 add_filter('clean_url', 'native_performance_defer_parsing_of_js',10,2); 95 95 } -
native-performance/trunk/includes/tweaks/footer.php
r2186154 r2352763 9 9 10 10 // Mover JavaScript al Footer. 11 function native_performance_defer_parsing_of_js($tag, $handle) { 12 if (is_admin()){ 13 return $tag; 14 } 15 if (strpos($tag, '/wp-includes/js/jquery/jquery')) { 16 return $tag; 17 } 18 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 9.') !==false) { 19 return $tag; 20 } 21 else { 22 return str_replace(' src',' defer src', $tag); 23 } 11 function native_performance_defer_parsing_of_js($url) { 12 if ( FALSE === strpos( $url, '.js' ) ) return $url; 13 if ( strpos( $url, 'jquery.js' ) ) return $url; 14 return "$url' defer "; 24 15 } -
native-performance/trunk/readme.txt
r2346855 r2352763 80 80 == Changelog == 81 81 82 83 = 1.2.7 = 84 * Fixed for Google site Kit 85 82 86 = 1.2.6 = 83 87 Tested up to: 5.5
Note: See TracChangeset
for help on using the changeset viewer.