Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-walker-category-dropdown.php

    r42201 r42343  
    3636     * @see Walker::$db_fields
    3737     */
    38     public $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
     38    public $db_fields = array(
     39        'parent' => 'parent',
     40        'id'     => 'term_id',
     41    );
    3942
    4043    /**
     
    5356     */
    5457    public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
    55         $pad = str_repeat(' ', $depth * 3);
     58        $pad = str_repeat( ' ', $depth * 3 );
    5659
    5760        /** This filter is documented in wp-includes/category-template.php */
     
    6467        }
    6568
    66         $output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . "\"";
     69        $output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . '"';
    6770
    6871        // Type-juggling causes false matches, so we force everything to a string.
    69         if ( (string) $category->{$value_field} === (string) $args['selected'] )
     72        if ( (string) $category->{$value_field} === (string) $args['selected'] ) {
    7073            $output .= ' selected="selected"';
     74        }
    7175        $output .= '>';
    72         $output .= $pad.$cat_name;
    73         if ( $args['show_count'] )
    74             $output .= '&nbsp;&nbsp;('. number_format_i18n( $category->count ) .')';
     76        $output .= $pad . $cat_name;
     77        if ( $args['show_count'] ) {
     78            $output .= '&nbsp;&nbsp;(' . number_format_i18n( $category->count ) . ')';
     79        }
    7580        $output .= "</option>\n";
    7681    }
Note: See TracChangeset for help on using the changeset viewer.