Make WordPress Core


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

    r43228 r43571  
    515515
    516516        wp_terms_checklist(
    517             0, array(
     517            0,
     518            array(
    518519                'taxonomy'             => $taxonomy->name,
    519520                'descendants_and_self' => $cat_id,
     
    548549
    549550        wp_terms_checklist(
    550             0, array(
     551            0,
     552            array(
    551553                'taxonomy'             => $taxonomy->name,
    552554                'descendants_and_self' => $term_id,
     
    9991001
    10001002    $tags = get_terms(
    1001         $taxonomy, array(
     1003        $taxonomy,
     1004        array(
    10021005            'number'  => 45,
    10031006            'orderby' => 'count',
     
    10211024    // We need raw tag names here, so don't filter the output
    10221025    $return = wp_generate_tag_cloud(
    1023         $tags, array(
     1026        $tags,
     1027        array(
    10241028            'filter' => 0,
    10251029            'format' => 'list',
     
    14611465                        'meta_value' => $value,
    14621466                        'meta_id'    => $mid,
    1463                     ), $c
     1467                    ),
     1468                    $c
    14641469                ),
    14651470                'position'     => 0,
     
    16261631        ob_start();
    16271632        call_user_func_array(
    1628             $callback, array(
     1633            $callback,
     1634            array(
    16291635                null,
    16301636                array(
     
    31673173
    31683174    $args = wp_parse_args(
    3169         wp_unslash( $_REQUEST['request'] ), array(
     3175        wp_unslash( $_REQUEST['request'] ),
     3176        array(
    31703177            'per_page' => 20,
    31713178            'fields'   => $theme_field_defaults,
     
    31973204                'theme'    => $theme->slug,
    31983205                '_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug ),
    3199             ), $update_php
     3206            ),
     3207            $update_php
    32003208        );
    32013209
     
    32073215                        '_wpnonce' => wp_create_nonce( 'enable-theme_' . $theme->slug ),
    32083216                        'theme'    => $theme->slug,
    3209                     ), network_admin_url( 'themes.php' )
     3217                    ),
     3218                    network_admin_url( 'themes.php' )
    32103219                );
    32113220            } else {
     
    32153224                        '_wpnonce'   => wp_create_nonce( 'switch-theme_' . $theme->slug ),
    32163225                        'stylesheet' => $theme->slug,
    3217                     ), admin_url( 'themes.php' )
     3226                    ),
     3227                    admin_url( 'themes.php' )
    32183228                );
    32193229            }
     
    32243234                array(
    32253235                    'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),
    3226                 ), wp_customize_url( $theme->slug )
     3236                ),
     3237                wp_customize_url( $theme->slug )
    32273238            );
    32283239        }
     
    36673678
    36683679    $api = themes_api(
    3669         'theme_information', array(
     3680        'theme_information',
     3681        array(
    36703682            'slug'   => $slug,
    36713683            'fields' => array( 'sections' => false ),
     
    37203732                    '_wpnonce' => wp_create_nonce( 'enable-theme_' . $slug ),
    37213733                    'theme'    => $slug,
    3722                 ), network_admin_url( 'themes.php' )
     3734                ),
     3735                network_admin_url( 'themes.php' )
    37233736            );
    37243737        } else {
     
    37283741                    '_wpnonce'   => wp_create_nonce( 'switch-theme_' . $slug ),
    37293742                    'stylesheet' => $slug,
    3730                 ), admin_url( 'themes.php' )
     3743                ),
     3744                admin_url( 'themes.php' )
    37313745            );
    37323746        }
     
    37373751            array(
    37383752                'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),
    3739             ), wp_customize_url( $slug )
     3753            ),
     3754            wp_customize_url( $slug )
    37403755        );
    37413756    }
     
    39513966
    39523967    $api = plugins_api(
    3953         'plugin_information', array(
     3968        'plugin_information',
     3969        array(
    39543970            'slug'   => sanitize_key( wp_unslash( $_POST['slug'] ) ),
    39553971            'fields' => array(
     
    40114027                'action'   => 'activate',
    40124028                'plugin'   => $install_status['file'],
    4013             ), $plugins_url
     4029            ),
     4030            $plugins_url
    40144031        );
    40154032    }
     
    42214238    /** @var WP_Plugins_List_Table $wp_list_table */
    42224239    $wp_list_table = _get_list_table(
    4223         'WP_Plugins_List_Table', array(
     4240        'WP_Plugins_List_Table',
     4241        array(
    42244242            'screen' => get_current_screen(),
    42254243        )
     
    42364254    $_SERVER['REQUEST_URI'] = add_query_arg(
    42374255        array_diff_key(
    4238             $_POST, array(
     4256            $_POST,
     4257            array(
    42394258                '_ajax_nonce' => null,
    42404259                'action'      => null,
    42414260            )
    4242         ), network_admin_url( 'plugins.php', 'relative' )
     4261        ),
     4262        network_admin_url( 'plugins.php', 'relative' )
    42434263    );
    42444264
     
    42704290    /** @var WP_Plugin_Install_List_Table $wp_list_table */
    42714291    $wp_list_table = _get_list_table(
    4272         'WP_Plugin_Install_List_Table', array(
     4292        'WP_Plugin_Install_List_Table',
     4293        array(
    42734294            'screen' => get_current_screen(),
    42744295        )
     
    42854306    $_SERVER['REQUEST_URI'] = add_query_arg(
    42864307        array_diff_key(
    4287             $_POST, array(
     4308            $_POST,
     4309            array(
    42884310                '_ajax_nonce' => null,
    42894311                'action'      => null,
    42904312            )
    4291         ), network_admin_url( 'plugin-install.php', 'relative' )
     4313        ),
     4314        network_admin_url( 'plugin-install.php', 'relative' )
    42924315    );
    42934316
Note: See TracChangeset for help on using the changeset viewer.