WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (3 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-includes/theme.php

    r43039 r43571  
    726726    if ( is_array( $_sidebars_widgets ) ) {
    727727        set_theme_mod(
    728             'sidebars_widgets', array(
     728            'sidebars_widgets',
     729            array(
    729730                'time' => time(),
    730731                'data' => $_sidebars_widgets,
     
    16781679        $style .= $image . $position . $size . $repeat . $attachment;
    16791680    }
    1680 ?>
     1681    ?>
    16811682<style type="text/css" id="custom-background-css">
    16821683body.custom-background { <?php echo trim( $style ); ?> }
    16831684</style>
    1684 <?php
     1685    <?php
    16851686}
    16861687
     
    16931694    $styles = wp_get_custom_css();
    16941695    if ( $styles || is_customize_preview() ) :
    1695     ?>
     1696        ?>
    16961697        <style type="text/css" id="wp-custom-css">
    16971698            <?php echo strip_tags( $styles ); // Note that esc_html() cannot be used because `div &gt; span` is not interpreted properly. ?>
    16981699        </style>
    1699     <?php
     1700        <?php
    17001701    endif;
    17011702}
     
    18031804function wp_update_custom_css_post( $css, $args = array() ) {
    18041805    $args = wp_parse_args(
    1805         $args, array(
     1806        $args,
     1807        array(
    18061808            'preprocessed' => '',
    18071809            'stylesheet'   => get_stylesheet(),
     
    20222024                    'title'  => _x( 'Find Us', 'Theme starter content' ),
    20232025                    'text'   => join(
    2024                         '', array(
     2026                        '',
     2027                        array(
    20252028                            '<strong>' . _x( 'Address', 'Theme starter content' ) . "</strong>\n",
    20262029                            _x( '123 Main Street', 'Theme starter content' ) . "\n" . _x( 'New York, NY 10001', 'Theme starter content' ) . "\n\n",
     
    25402543                /* translators: 1: title-tag, 2: wp_loaded */
    25412544                _doing_it_wrong(
    2542                     "add_theme_support( 'title-tag' )", sprintf(
     2545                    "add_theme_support( 'title-tag' )",
     2546                    sprintf(
    25432547                        __( 'Theme support for %1$s should be registered before the %2$s hook.' ),
    2544                         '<code>title-tag</code>', '<code>wp_loaded</code>'
    2545                     ), '4.1.0'
     2548                        '<code>title-tag</code>',
     2549                        '<code>wp_loaded</code>'
     2550                    ),
     2551                    '4.1.0'
    25462552                );
    25472553
     
    26142620            }
    26152621        </style>
    2616     <?php
     2622        <?php
    26172623    }
    26182624}
Note: See TracChangeset for help on using the changeset viewer.