WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (3 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-page.php

    r42201 r42343  
    3636     * @todo Decouple this.
    3737     */
    38     public $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
     38    public $db_fields = array(
     39        'parent' => 'post_parent',
     40        'id'     => 'ID',
     41    );
    3942
    4043    /**
     
    5861            $n = '';
    5962        }
    60         $indent = str_repeat( $t, $depth );
     63        $indent  = str_repeat( $t, $depth );
    6164        $output .= "{$n}{$indent}<ul class='children'>{$n}";
    6265    }
     
    8285            $n = '';
    8386        }
    84         $indent = str_repeat( $t, $depth );
     87        $indent  = str_repeat( $t, $depth );
    8588        $output .= "{$indent}</ul>{$n}";
    8689    }
     
    128131                $css_class[] = 'current_page_parent';
    129132            }
    130         } elseif ( $page->ID == get_option('page_for_posts') ) {
     133        } elseif ( $page->ID == get_option( 'page_for_posts' ) ) {
    131134            $css_class[] = 'current_page_parent';
    132135        }
     
    154157
    155158        $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before'];
    156         $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after'];
    157 
    158         $atts = array();
     159        $args['link_after']  = empty( $args['link_after'] ) ? '' : $args['link_after'];
     160
     161        $atts         = array();
    159162        $atts['href'] = get_permalink( $page->ID );
    160163
     
    179182        foreach ( $atts as $attr => $value ) {
    180183            if ( ! empty( $value ) ) {
    181                 $value = esc_attr( $value );
     184                $value       = esc_attr( $value );
    182185                $attributes .= ' ' . $attr . '="' . $value . '"';
    183186            }
     
    202205
    203206            $date_format = empty( $args['date_format'] ) ? '' : $args['date_format'];
    204             $output .= " " . mysql2date( $date_format, $time );
     207            $output     .= ' ' . mysql2date( $date_format, $time );
    205208        }
    206209    }
Note: See TracChangeset for help on using the changeset viewer.