Make WordPress Core


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

    r46964 r47122  
    8989}
    9090
    91 // These are the widgets grouped by sidebar
     91// These are the widgets grouped by sidebar.
    9292$sidebars_widgets = wp_get_sidebars_widgets();
    9393
     
    102102
    103103    if ( ! is_registered_sidebar( $sidebar_id ) ) {
    104         if ( ! empty( $widgets ) ) { // register the inactive_widgets area as sidebar
     104        if ( ! empty( $widgets ) ) { // Register the inactive_widgets area as sidebar.
    105105            register_sidebar(
    106106                array(
     
    121121}
    122122
    123 // register the inactive_widgets area as sidebar
     123// Register the inactive_widgets area as sidebar.
    124124register_sidebar(
    125125    array(
     
    137137retrieve_widgets();
    138138
    139 // We're saving a widget without js
     139// We're saving a widget without JS.
    140140if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) {
    141141    $widget_id = $_POST['widget-id'];
     
    217217}
    218218
    219 // Remove inactive widgets without js
     219// Remove inactive widgets without JS.
    220220if ( isset( $_POST['removeinactivewidgets'] ) ) {
    221221    check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' );
     
    239239}
    240240
    241 // Output the widget form without js
     241// Output the widget form without JS.
    242242if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
    243243    $widget_id = $_GET['editwidget'];
    244244
    245245    if ( isset( $_GET['addnew'] ) ) {
    246         // Default to the first sidebar
     246        // Default to the first sidebar.
    247247        $keys    = array_keys( $wp_registered_sidebars );
    248248        $sidebar = reset( $keys );
    249249
    250         if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // multi-widget
    251             // Copy minimal info from an existing instance of this widget to a new instance
     250        if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // Multi-widget.
     251            // Copy minimal info from an existing instance of this widget to a new instance.
    252252            foreach ( $wp_registered_widget_controls as $control ) {
    253253                if ( $_GET['base'] === $control['id_base'] ) {
     
    540540    ?>
    541541    <div class="<?php echo esc_attr( $wrap_class ); ?>">
    542         <?php wp_list_widget_controls( $sidebar, $registered_sidebar['name'] ); // Show the control forms for each of the widgets in this sidebar ?>
     542        <?php
     543        // Show the control forms for each of the widgets in this sidebar.
     544        wp_list_widget_controls( $sidebar, $registered_sidebar['name'] );
     545        ?>
    543546    </div>
    544547    <?php
Note: See TracChangeset for help on using the changeset viewer.