Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (4 years 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/widgets.php

    r47027 r47122  
    2020
    2121//
    22 // Global Variables
     22// Global Variables.
    2323//
    2424
     
    9292
    9393//
    94 // Template tags & API functions
     94// Template tags & API functions.
    9595//
    9696
     
    187187
    188188        // Custom specified ID's are suffixed if they exist already.
    189         // Automatically generated sidebar names need to be suffixed regardless starting at -0
     189        // Automatically generated sidebar names need to be suffixed regardless starting at -0.
    190190        if ( isset( $args['id'] ) ) {
    191191            $_args['id'] = $args['id'];
    192             $n           = 2; // Start at -2 for conflicting custom ID's
     192            $n           = 2; // Start at -2 for conflicting custom IDs.
    193193            while ( is_registered_sidebar( $_args['id'] ) ) {
    194194                $_args['id'] = $args['id'] . '-' . $n++;
     
    530530        'width'  => 250,
    531531        'height' => 200,
    532     ); // height is never used
     532    ); // Height is never used.
    533533    $options           = wp_parse_args( $options, $defaults );
    534534    $options['width']  = (int) $options['width'];
     
    727727        );
    728728
    729         // Substitute HTML id and class attributes into before_widget
     729        // Substitute HTML `id` and `class` attributes into `before_widget`.
    730730        $classname_ = '';
    731731        foreach ( (array) $wp_registered_widgets[ $id ]['classname'] as $cn ) {
     
    948948
    949949//
    950 // Internal Functions
     950// Internal Functions.
    951951//
    952952
     
    10761076        $settings = array( 2 => $settings );
    10771077
    1078         // If loading from the front page, update sidebar in memory but don't save to options
     1078        // If loading from the front page, update sidebar in memory but don't save to options.
    10791079        if ( is_admin() ) {
    10801080            $sidebars_widgets = get_option( 'sidebars_widgets' );
     
    13771377                                continue 3;
    13781378                            }
    1379                         } // endforeach ( $slug_group as $slug )
    1380                     } // endforeach ( $existing_sidebars_widgets as $sidebar => $widgets )
    1381                 } // endforeach foreach ( $wp_registered_sidebars as $new_sidebar => $args )
    1382             } // endforeach ( $slug_group as $slug )
    1383         } // endforeach ( $common_slug_groups as $slug_group )
     1379                        } // End foreach ( $slug_group as $slug ).
     1380                    } // End foreach ( $existing_sidebars_widgets as $sidebar => $widgets ).
     1381                } // End foreach ( $wp_registered_sidebars as $new_sidebar => $args ).
     1382            } // End foreach ( $slug_group as $slug ).
     1383        } // End foreach ( $common_slug_groups as $slug_group ).
    13841384    }
    13851385
     
    14411441                                unset( $old_sidebars_widgets[ $old_sidebar ][ $key ] );
    14421442                            }
    1443                         } // endif ( $active_key )
    1444                     } // endforeach ( $old_widgets as $key => $widget_id )
    1445                 } // endforeach ( $new_sidebars_widgets as $new_sidebar => $new_widgets )
    1446             } // endforeach ( $old_sidebars_widgets as $old_sidebar => $old_widgets )
    1447         } // endif ( ! empty( $old_sidebars_widgets ) )
     1443                        } // End if ( $active_key ).
     1444                    } // End foreach ( $old_widgets as $key => $widget_id ).
     1445                } // End foreach ( $new_sidebars_widgets as $new_sidebar => $new_widgets ).
     1446            } // End foreach ( $old_sidebars_widgets as $old_sidebar => $old_widgets ).
     1447        } // End if ( ! empty( $old_sidebars_widgets ) ).
    14481448
    14491449        // Restore widget settings from when theme was previously active.
Note: See TracChangeset for help on using the changeset viewer.