WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (2 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-dropdown.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    /**
     
    5558     */
    5659    public function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
    57         $pad = str_repeat(' ', $depth * 3);
     60        $pad = str_repeat( ' ', $depth * 3 );
    5861
    5962        if ( ! isset( $args['value_field'] ) || ! isset( $page->{$args['value_field']} ) ) {
     
    6164        }
    6265
    63         $output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $page->{$args['value_field']} ) . "\"";
    64         if ( $page->ID == $args['selected'] )
     66        $output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $page->{$args['value_field']} ) . '"';
     67        if ( $page->ID == $args['selected'] ) {
    6568            $output .= ' selected="selected"';
     69        }
    6670        $output .= '>';
    6771
Note: See TracChangeset for help on using the changeset viewer.