Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (8 years ago)
Author:
pento
Message:

Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:

  • Multiline function calls must now put each parameter on a new line.
  • Auto-formatting files is now part of the grunt precommit script.
  • Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/inc/customizer.php

    r42343 r43571  
    1919
    2020        $wp_customize->selective_refresh->add_partial(
    21                 'blogname', array(
     21                'blogname',
     22                array(
    2223                        'selector'        => '.site-title a',
    2324                        'render_callback' => 'twentyseventeen_customize_partial_blogname',
     
    2526        );
    2627        $wp_customize->selective_refresh->add_partial(
    27                 'blogdescription', array(
     28                'blogdescription',
     29                array(
    2830                        'selector'        => '.site-description',
    2931                        'render_callback' => 'twentyseventeen_customize_partial_blogdescription',
     
    3537         */
    3638        $wp_customize->add_setting(
    37                 'colorscheme', array(
     39                'colorscheme',
     40                array(
    3841                        'default'           => 'light',
    3942                        'transport'         => 'postMessage',
     
    4346
    4447        $wp_customize->add_setting(
    45                 'colorscheme_hue', array(
     48                'colorscheme_hue',
     49                array(
    4650                        'default'           => 250,
    4751                        'transport'         => 'postMessage',
     
    5155
    5256        $wp_customize->add_control(
    53                 'colorscheme', array(
     57                'colorscheme',
     58                array(
    5459                        'type'     => 'radio',
    5560                        'label'    => __( 'Color Scheme', 'twentyseventeen' ),
     
    6671        $wp_customize->add_control(
    6772                new WP_Customize_Color_Control(
    68                         $wp_customize, 'colorscheme_hue', array(
     73                        $wp_customize,
     74                        'colorscheme_hue',
     75                        array(
    6976                                'mode'     => 'hue',
    7077                                'section'  => 'colors',
     
    7885         */
    7986        $wp_customize->add_section(
    80                 'theme_options', array(
     87                'theme_options',
     88                array(
    8189                        'title'    => __( 'Theme Options', 'twentyseventeen' ),
    8290                        'priority' => 130, // Before Additional CSS.
     
    8593
    8694        $wp_customize->add_setting(
    87                 'page_layout', array(
     95                'page_layout',
     96                array(
    8897                        'default'           => 'two-column',
    8998                        'sanitize_callback' => 'twentyseventeen_sanitize_page_layout',
     
    93102
    94103        $wp_customize->add_control(
    95                 'page_layout', array(
     104                'page_layout',
     105                array(
    96106                        'label'           => __( 'Page Layout', 'twentyseventeen' ),
    97107                        'section'         => 'theme_options',
     
    118128        for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {
    119129                $wp_customize->add_setting(
    120                         'panel_' . $i, array(
     130                        'panel_' . $i,
     131                        array(
    121132                                'default'           => false,
    122133                                'sanitize_callback' => 'absint',
     
    126137
    127138                $wp_customize->add_control(
    128                         'panel_' . $i, array(
     139                        'panel_' . $i,
     140                        array(
    129141                                /* translators: %d is the front page section number */
    130142                                'label'           => sprintf( __( 'Front Page Section %d Content', 'twentyseventeen' ), $i ),
     
    138150
    139151                $wp_customize->selective_refresh->add_partial(
    140                         'panel_' . $i, array(
     152                        'panel_' . $i,
     153                        array(
    141154                                'selector'            => '#panel' . $i,
    142155                                'render_callback'     => 'twentyseventeen_front_page_section',
Note: See TracChangeset for help on using the changeset viewer.