Changeset 6658
- Timestamp:
- 02/16/2018 06:55:40 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
r6656 r6658 89 89 90 90 /** 91 * Filters an enqueued script's fully-qualified URL. 92 * 93 * @param string $src The source URL of the enqueued script. 94 * @param string $handle The script's registered handle. 95 * @return string 96 */ 97 function script_src( $src, $handle ) { 98 $cdn_handles = [ 99 'wporg-page-stats', 100 ]; 101 102 // Use CDN url. 103 if ( in_array( $handle, $cdn_handles, true ) ) { 104 $src = str_replace( get_home_url(), 'https://s.w.org', $src ); 105 } 106 107 return $src; 108 } 109 add_filter( 'script_loader_src', __NAMESPACE__ . '\script_src', 10, 2 ); 110 111 /** 91 112 * Extend the default WordPress body classes. 92 113 *
Note: See TracChangeset
for help on using the changeset viewer.