WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

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

    r46452 r47122  
    136136        $id       = $element->$id_field;
    137137
    138         //display this element
     138        // Display this element.
    139139        $this->has_children = ! empty( $children_elements[ $id ] );
    140140        if ( isset( $args[0] ) && is_array( $args[0] ) ) {
     
    144144        $this->start_el( $output, $element, $depth, ...array_values( $args ) );
    145145
    146         // descend only when the depth is right and there are childrens for this element
     146        // Descend only when the depth is right and there are childrens for this element.
    147147        if ( ( $max_depth == 0 || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) {
    148148
     
    151151                if ( ! isset( $newlevel ) ) {
    152152                    $newlevel = true;
    153                     //start the child delimiter
     153                    // Start the child delimiter.
    154154                    $this->start_lvl( $output, $depth, ...array_values( $args ) );
    155155                }
     
    160160
    161161        if ( isset( $newlevel ) && $newlevel ) {
    162             //end the child delimiter
     162            // End the child delimiter.
    163163            $this->end_lvl( $output, $depth, ...array_values( $args ) );
    164164        }
    165165
    166         //end this element
     166        // End this element.
    167167        $this->end_el( $output, $element, $depth, ...array_values( $args ) );
    168168    }
     
    189189        $output = '';
    190190
    191         //invalid parameter or nothing to walk
     191        // Invalid parameter or nothing to walk.
    192192        if ( $max_depth < -1 || empty( $elements ) ) {
    193193            return $output;
     
    196196        $parent_field = $this->db_fields['parent'];
    197197
    198         // flat display
     198        // Flat display.
    199199        if ( -1 == $max_depth ) {
    200200            $empty_array = array();
     
    296296        }
    297297        if ( $page_num < 1 || $per_page < 0 ) {
    298             // No paging
     298            // No paging.
    299299            $paging = false;
    300300            $start  = 0;
     
    312312        }
    313313
    314         // flat display
     314        // Flat display.
    315315        if ( -1 == $max_depth ) {
    316316            if ( ! empty( $args[0]['reverse_top_level'] ) ) {
     
    445445    }
    446446
    447 } // Walker
     447}
Note: See TracChangeset for help on using the changeset viewer.