Changeset 6211
- Timestamp:
- 12/03/2017 05:42:32 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg/functions.php
r6202 r6211 58 58 ) ) ); 59 59 60 add_theme_support( 'wp4-styles' ); 61 60 62 $GLOBALS['pagetitle'] = __( 'WordPress.org', 'wporg' ); 61 63 } … … 79 81 function scripts() { 80 82 $suffix = is_rtl() ? '-rtl' : ''; 81 wp_enqueue_style( 'wporg-style', get_stylesheet_directory_uri() . "/css/style{$suffix}.css", [ ], time());83 wp_enqueue_style( 'wporg-style', get_stylesheet_directory_uri() . "/css/style{$suffix}.css", ['dashicons', 'open-sans'], '20171202' ); 82 84 83 85 //wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true ); … … 103 105 104 106 /** 107 * Filters an enqueued style's fully-qualified URL. 108 * 109 * @param string $src The source URL of the enqueued style. 110 * @param string $handle The style's registered handle. 111 */ 112 function style_src( $src, $handle ) { 113 // Use CDN url. 114 if ( in_array( $handle, ['wporg-style', 'dashicons'], true ) ) { 115 $src = str_replace( get_home_url(), 'https://s.w.org', $src ); 116 } 117 118 // Remove version argument. 119 if ( in_array( $handle, ['open-sans'], true ) ) { 120 $src = remove_query_arg( 'ver', $src ); 121 } 122 123 return $src; 124 } 125 add_filter( 'style_loader_src', __NAMESPACE__ . '\style_src', 10, 2 ); 126 127 /** 105 128 * Add postMessage support for site title and description for the Theme Customizer. 106 129 *
Note: See TracChangeset
for help on using the changeset viewer.