Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 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-admin/includes/class-walker-category-checklist.php

    r41688 r42343  
    1919class Walker_Category_Checklist extends Walker {
    2020    public $tree_type = 'category';
    21     public $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
     21    public $db_fields = array(
     22        'parent' => 'parent',
     23        'id'     => 'term_id',
     24    ); //TODO: decouple this
    2225
    2326    /**
     
    3336     */
    3437    public function start_lvl( &$output, $depth = 0, $args = array() ) {
    35         $indent = str_repeat("\t", $depth);
     38        $indent  = str_repeat( "\t", $depth );
    3639        $output .= "$indent<ul class='children'>\n";
    3740    }
     
    4952     */
    5053    public function end_lvl( &$output, $depth = 0, $args = array() ) {
    51         $indent = str_repeat("\t", $depth);
     54        $indent  = str_repeat( "\t", $depth );
    5255        $output .= "$indent</ul>\n";
    5356    }
     
    8083
    8184        $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
    82         $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
     85        $class                = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
    8386
    8487        $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
     
    8689        if ( ! empty( $args['list_only'] ) ) {
    8790            $aria_checked = 'false';
    88             $inner_class = 'category';
     91            $inner_class  = 'category';
    8992
    9093            if ( in_array( $category->term_id, $args['selected_cats'] ) ) {
     
    101104            /** This filter is documented in wp-includes/category-template.php */
    102105            $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
    103                 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' .
     106                '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
    104107                checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) .
    105108                disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
Note: See TracChangeset for help on using the changeset viewer.