Changeset 47122 for trunk/src/wp-admin/widgets.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/widgets.php
r46964 r47122 89 89 } 90 90 91 // These are the widgets grouped by sidebar 91 // These are the widgets grouped by sidebar. 92 92 $sidebars_widgets = wp_get_sidebars_widgets(); 93 93 … … 102 102 103 103 if ( ! is_registered_sidebar( $sidebar_id ) ) { 104 if ( ! empty( $widgets ) ) { // register the inactive_widgets area as sidebar104 if ( ! empty( $widgets ) ) { // Register the inactive_widgets area as sidebar. 105 105 register_sidebar( 106 106 array( … … 121 121 } 122 122 123 // register the inactive_widgets area as sidebar123 // Register the inactive_widgets area as sidebar. 124 124 register_sidebar( 125 125 array( … … 137 137 retrieve_widgets(); 138 138 139 // We're saving a widget without js139 // We're saving a widget without JS. 140 140 if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) { 141 141 $widget_id = $_POST['widget-id']; … … 217 217 } 218 218 219 // Remove inactive widgets without js219 // Remove inactive widgets without JS. 220 220 if ( isset( $_POST['removeinactivewidgets'] ) ) { 221 221 check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); … … 239 239 } 240 240 241 // Output the widget form without js241 // Output the widget form without JS. 242 242 if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) { 243 243 $widget_id = $_GET['editwidget']; 244 244 245 245 if ( isset( $_GET['addnew'] ) ) { 246 // Default to the first sidebar 246 // Default to the first sidebar. 247 247 $keys = array_keys( $wp_registered_sidebars ); 248 248 $sidebar = reset( $keys ); 249 249 250 if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // multi-widget251 // 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. 252 252 foreach ( $wp_registered_widget_controls as $control ) { 253 253 if ( $_GET['base'] === $control['id_base'] ) { … … 540 540 ?> 541 541 <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 ?> 543 546 </div> 544 547 <?php
Note: See TracChangeset
for help on using the changeset viewer.