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/twentysixteen/inc/customizer.php

    r42343 r43571  
    3232         */
    3333        add_theme_support(
    34                 'custom-background', apply_filters(
    35                         'twentysixteen_custom_background_args', array(
     34                'custom-background',
     35                apply_filters(
     36                        'twentysixteen_custom_background_args',
     37                        array(
    3638                                'default-color' => $default_background_color,
    3739                        )
     
    5658         */
    5759        add_theme_support(
    58                 'custom-header', apply_filters(
    59                         'twentysixteen_custom_header_args', array(
     60                'custom-header',
     61                apply_filters(
     62                        'twentysixteen_custom_header_args',
     63                        array(
    6064                                'default-text-color' => $default_text_color,
    6165                                'width'              => 1200,
     
    117121        if ( isset( $wp_customize->selective_refresh ) ) {
    118122                $wp_customize->selective_refresh->add_partial(
    119                         'blogname', array(
     123                        'blogname',
     124                        array(
    120125                                'selector'            => '.site-title a',
    121126                                'container_inclusive' => false,
     
    124129                );
    125130                $wp_customize->selective_refresh->add_partial(
    126                         'blogdescription', array(
     131                        'blogdescription',
     132                        array(
    127133                                'selector'            => '.site-description',
    128134                                'container_inclusive' => false,
     
    134140        // Add color scheme setting and control.
    135141        $wp_customize->add_setting(
    136                 'color_scheme', array(
     142                'color_scheme',
     143                array(
    137144                        'default'           => 'default',
    138145                        'sanitize_callback' => 'twentysixteen_sanitize_color_scheme',
     
    142149
    143150        $wp_customize->add_control(
    144                 'color_scheme', array(
     151                'color_scheme',
     152                array(
    145153                        'label'    => __( 'Base Color Scheme', 'twentysixteen' ),
    146154                        'section'  => 'colors',
     
    153161        // Add page background color setting and control.
    154162        $wp_customize->add_setting(
    155                 'page_background_color', array(
     163                'page_background_color',
     164                array(
    156165                        'default'           => $color_scheme[1],
    157166                        'sanitize_callback' => 'sanitize_hex_color',
     
    162171        $wp_customize->add_control(
    163172                new WP_Customize_Color_Control(
    164                         $wp_customize, 'page_background_color', array(
     173                        $wp_customize,
     174                        'page_background_color',
     175                        array(
    165176                                'label'   => __( 'Page Background Color', 'twentysixteen' ),
    166177                                'section' => 'colors',
     
    174185        // Add link color setting and control.
    175186        $wp_customize->add_setting(
    176                 'link_color', array(
     187                'link_color',
     188                array(
    177189                        'default'           => $color_scheme[2],
    178190                        'sanitize_callback' => 'sanitize_hex_color',
     
    183195        $wp_customize->add_control(
    184196                new WP_Customize_Color_Control(
    185                         $wp_customize, 'link_color', array(
     197                        $wp_customize,
     198                        'link_color',
     199                        array(
    186200                                'label'   => __( 'Link Color', 'twentysixteen' ),
    187201                                'section' => 'colors',
     
    192206        // Add main text color setting and control.
    193207        $wp_customize->add_setting(
    194                 'main_text_color', array(
     208                'main_text_color',
     209                array(
    195210                        'default'           => $color_scheme[3],
    196211                        'sanitize_callback' => 'sanitize_hex_color',
     
    201216        $wp_customize->add_control(
    202217                new WP_Customize_Color_Control(
    203                         $wp_customize, 'main_text_color', array(
     218                        $wp_customize,
     219                        'main_text_color',
     220                        array(
    204221                                'label'   => __( 'Main Text Color', 'twentysixteen' ),
    205222                                'section' => 'colors',
     
    210227        // Add secondary text color setting and control.
    211228        $wp_customize->add_setting(
    212                 'secondary_text_color', array(
     229                'secondary_text_color',
     230                array(
    213231                        'default'           => $color_scheme[4],
    214232                        'sanitize_callback' => 'sanitize_hex_color',
     
    219237        $wp_customize->add_control(
    220238                new WP_Customize_Color_Control(
    221                         $wp_customize, 'secondary_text_color', array(
     239                        $wp_customize,
     240                        'secondary_text_color',
     241                        array(
    222242                                'label'   => __( 'Secondary Text Color', 'twentysixteen' ),
    223243                                'section' => 'colors',
     
    290310         */
    291311        return apply_filters(
    292                 'twentysixteen_color_schemes', array(
     312                'twentysixteen_color_schemes',
     313                array(
    293314                        'default' => array(
    294315                                'label'  => __( 'Default', 'twentysixteen' ),
     
    489510function twentysixteen_get_color_scheme_css( $colors ) {
    490511        $colors = wp_parse_args(
    491                 $colors, array(
     512                $colors,
     513                array(
    492514                        'background_color'      => '',
    493515                        'page_background_color' => '',
Note: See TracChangeset for help on using the changeset viewer.