Changeset 6284 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
- Timestamp:
- 12/18/2017 05:42:35 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
r6249 r6284 9 9 10 10 namespace WordPressdotorg\Plugin_Directory\Theme; 11 11 12 use WordPressdotorg\Plugin_Directory\Plugin_Directory; 12 13 use WordPressdotorg\Plugin_Directory\Template; … … 24 25 add_theme_support( 'automatic-feed-links' ); 25 26 26 // Don't include Adjacent Posts functionality 27 // Don't include Adjacent Posts functionality. 27 28 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); 28 29 … … 60 61 function scripts() { 61 62 $suffix = is_rtl() ? '-rtl' : ''; 62 wp_enqueue_style( 'wporg-plugins-style', get_template_directory_uri() . "/css/style{$suffix}.css", [ 'open-sans'], '20171206a' );63 wp_enqueue_style( 'wporg-plugins-style', get_template_directory_uri() . "/css/style{$suffix}.css", [ 'open-sans', 'dashicons' ], '20171206a' ); 63 64 64 65 wp_enqueue_script( 'wporg-plugins-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true ); … … 98 99 } 99 100 100 // React is currently only used on detail pages 101 // React is currently only used on detail pages. 101 102 if ( is_single() ) { 102 103 wp_enqueue_script( 'wporg-plugins-client', get_template_directory_uri() . '/js/theme.js', array(), '20170501', true ); … … 111 112 'Plural-Forms' => _x( 'nplurals=2; plural=n != 1;', 'plural forms', 'wporg-plugins' ), 112 113 'Language' => _x( 'en', 'language (fr, fr_CA)', 'wporg-plugins' ), 113 'localeSlug' => _x( 'en', 'locale slug', 'wporg-plugins' ) 114 'localeSlug' => _x( 'en', 'locale slug', 'wporg-plugins' ), 114 115 ), 115 116 ) ); … … 148 149 149 150 // Remove version argument. 150 if ( in_array( $handle, [ 'open-sans'], true ) ) {151 if ( in_array( $handle, [ 'open-sans' ], true ) ) { 151 152 $src = remove_query_arg( 'ver', $src ); 152 153 } … … 154 155 return $src; 155 156 } 156 add_filter( 'style_loader_src', 157 add_filter( 'style_loader_src', __NAMESPACE__ . '\loader_src', 10, 2 ); 157 158 add_filter( 'script_loader_src', __NAMESPACE__ . '\loader_src', 10, 2 ); 158 159 … … 171 172 */ 172 173 function customize_register( $wp_customize ) { 173 $wp_customize->get_setting( 'blogname' )->transport 174 $wp_customize->get_setting( 'blogdescription' )->transport 174 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 175 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 175 176 } 176 177 add_action( 'customize_register', __NAMESPACE__ . '\customize_register' ); … … 182 183 wp_enqueue_script( 'wporg_plugins_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); 183 184 } 184 add_action( 'customize_preview_init', __NAMESPACE__ . '\customize_preview_js' ); 185 186 185 add_action( 'customize_preview_init', __NAMESPACE__ . '\customize_preview_js' ); 186 187 /** 188 * Filters the list of CSS body classes for the current post or page. 189 * 190 * @param array $classes An array of body classes. 191 * @return array 192 */ 187 193 function custom_body_class( $classes ) { 188 194 $classes[] = 'no-js'; … … 206 212 function document_title( $title ) { 207 213 if ( is_front_page() ) { 208 $title['title'] = __( 'WordPress Plugins', 'wporg-plugins' );214 $title['title'] = __( 'WordPress Plugins', 'wporg-plugins' ); 209 215 $title['tagline'] = __( 'Plugins extend and expand the functionality of WordPress.', 'wporg-plugins' ); 210 216 } else { … … 260 266 } 261 267 262 $banner = Template::get_plugin_banner(); 268 $icon = Template::get_plugin_icon(); 269 $banner = Template::get_plugin_banner(); 270 263 271 $banner['banner_2x'] = $banner['banner_2x'] ? $banner['banner'] : false; 264 $icon = Template::get_plugin_icon();265 272 266 273 printf( '<meta property="og:title" content="%s" />' . "\n", the_title_attribute( array( 'echo' => false ) ) ); … … 295 302 add_action( 'wp_head', function() { 296 303 add_filter( 'post_type_archive_title', __NAMESPACE__ . '\strong_archive_title' ); 297 add_filter( 'single_term_title', 298 add_filter( 'single_cat_title', 299 add_filter( 'single_tag_title', 300 add_filter( 'get_the_date', 304 add_filter( 'single_term_title', __NAMESPACE__ . '\strong_archive_title' ); 305 add_filter( 'single_cat_title', __NAMESPACE__ . '\strong_archive_title' ); 306 add_filter( 'single_tag_title', __NAMESPACE__ . '\strong_archive_title' ); 307 add_filter( 'get_the_date', __NAMESPACE__ . '\strong_archive_title' ); 301 308 } ); 302 309
Note: See TracChangeset
for help on using the changeset viewer.