WordPress.org

Making WordPress.org


Ignore:
Timestamp:
12/15/2017 12:13:33 AM (3 years ago)
Author:
obenland
Message:

Main: Conform to WPCS.

See #2861.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg/functions.php

    r6248 r6277  
    3232    add_theme_support( 'automatic-feed-links' );
    3333
    34     // Don't include Adjacent Posts functionality
     34    // Don't include Adjacent Posts functionality.
    3535    remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
    3636
     
    8181function scripts() {
    8282    $suffix = is_rtl() ? '-rtl' : '';
    83     wp_enqueue_style( 'wporg-style', get_stylesheet_directory_uri() . "/css/style{$suffix}.css", ['dashicons', 'open-sans'], '20171207' );
    84 
    85     //wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );
     83    wp_enqueue_style( 'wporg-style', get_stylesheet_directory_uri() . "/css/style{$suffix}.css", [ 'dashicons', 'open-sans' ], '20171207' );
     84
     85    // phpcs:ignore Squiz.PHP.CommentedOutCode.Found, Squiz.Commenting.InlineComment.InvalidEndChar
     86    // wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );
    8687    wp_enqueue_script( 'wporg-plugins-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
    8788
     
    123124
    124125    // Remove version argument.
    125     if ( in_array( $handle, ['open-sans'], true ) ) {
     126    if ( in_array( $handle, [ 'open-sans' ], true ) ) {
    126127        $src = remove_query_arg( 'ver', $src );
    127128    }
     
    137138 */
    138139function customize_register( $wp_customize ) {
    139     $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
    140     $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
     140    $wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';
     141    $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
    141142}
    142143add_action( 'customize_register', __NAMESPACE__ . '\customize_register' );
     
    148149    wp_enqueue_script( 'wporg_plugins_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true );
    149150}
    150 add_action( 'customize_preview_init',  __NAMESPACE__ . '\customize_preview_js' );
     151add_action( 'customize_preview_init', __NAMESPACE__ . '\customize_preview_js' );
    151152
    152153
     
    160161    wp_cache_add_global_groups( array( 'locale-associations' ) );
    161162
    162     if ( false === ( $sites = wp_cache_get( 'local-sites', 'locale-associations' ) ) ) {
     163    $sites = wp_cache_get( 'local-sites', 'locale-associations' );
     164
     165    if ( false === $sites ) {
    163166        global $wpdb;
    164167
     168        // phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
    165169        $sites = $wpdb->get_results( 'SELECT locale, subdomain FROM locales', OBJECT_K );
    166170        if ( ! $sites ) {
     
    188192            'locale'    => 'en_US',
    189193            'hreflang'  => 'en',
    190             'subdomain' => ''
     194            'subdomain' => '',
    191195        );
    192196
     
    202206            'https://%swordpress.org%s',
    203207            $site->subdomain ? "{$site->subdomain}." : '',
    204             $_SERVER[ 'REQUEST_URI' ]
     208            $_SERVER['REQUEST_URI'] // phpcs:ignore
    205209        );
    206210
Note: See TracChangeset for help on using the changeset viewer.