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-admin/includes/nav-menu.php

    r43569 r43571  
    106106                } elseif ( 'taxonomy' == $matches[1] ) {
    107107                        $terms = get_terms(
    108                                 $matches[2], array(
     108                                $matches[2],
     109                                array(
    109110                                        'name__like' => $query,
    110111                                        'number'     => 10,
    … …  
    150151                $user = wp_get_current_user();
    151152                update_user_option(
    152                         $user->ID, 'managenav-menuscolumnshidden',
     153                        $user->ID,
     154                        'managenav-menuscolumnshidden',
    153155                        array(
    154156                                0 => 'link-target',
    … …  
    440442                                <?php
    441443                                $recent_args    = array_merge(
    442                                         $args, array(
     444                                        $args,
     445                                        array(
    443446                                                'orderby'        => 'post_date',
    444447                                                'order'          => 'DESC',
    … …  
    531534                                                $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
    532535                                                array_unshift(
    533                                                         $posts, (object) array(
     536                                                        $posts,
     537                                                        (object) array(
    534538                                                                'front_or_home' => true,
    535539                                                                'ID'            => 0,
    … …  
    552556                                        $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
    553557                                        array_unshift(
    554                                                 $posts, (object) array(
     558                                                $posts,
     559                                                (object) array(
    555560                                                        'ID'           => 0,
    556561                                                        'object_id'    => $_nav_menu_placeholder,
    … …  
    678683        $num_pages = ceil(
    679684                wp_count_terms(
    680                         $taxonomy_name, array_merge(
    681                                 $args, array(
     685                        $taxonomy_name,
     686                        array_merge(
     687                                $args,
     688                                array(
    682689                                        'number' => '',
    683690                                        'offset' => '',
    … …  
    764771                                <?php
    765772                                $popular_terms  = get_terms(
    766                                         $taxonomy_name, array(
     773                                        $taxonomy_name,
     774                                        array(
    767775                                                'orderby'      => 'count',
    768776                                                'order'        => 'DESC',
    … …  
    801809                                $searched       = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] );
    802810                                $search_results = get_terms(
    803                                         $taxonomy_name, array(
     811                                        $taxonomy_name,
     812                                        array(
    804813                                                'name__like'   => $searched,
    805814                                                'fields'       => 'all',
    … …  
    10971106function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) {
    10981107        $unsorted_menu_items = wp_get_nav_menu_items(
    1099                 $nav_menu_selected_id, array(
     1108                $nav_menu_selected_id,
     1109                array(
    11001110                        'orderby'     => 'ID',
    11011111                        'output'      => ARRAY_A,
Note: See TracChangeset for help on using the changeset viewer.