wp/wp-admin/widgets.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
     5  * @package WordPress
     5  * @package WordPress
     6  * @subpackage Administration
     6  * @subpackage Administration
     7  */
     7  */
     8 
     8 
     9 /** WordPress Administration Bootstrap */
     9 /** WordPress Administration Bootstrap */
    10 require_once( dirname( __FILE__ ) . '/admin.php' );
    10 require_once __DIR__ . '/admin.php';
    11 
    11 
    12 /** WordPress Administration Widgets API */
    12 /** WordPress Administration Widgets API */
    13 require_once( ABSPATH . 'wp-admin/includes/widgets.php' );
    13 require_once ABSPATH . 'wp-admin/includes/widgets.php';
    14 
    14 
    15 if ( ! current_user_can( 'edit_theme_options' ) ) {
    15 if ( ! current_user_can( 'edit_theme_options' ) ) {
    16 	wp_die(
    16 	wp_die(
    17 		'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
    17 		'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
    18 		'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
    18 		'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
    22 
    22 
    23 $widgets_access = get_user_setting( 'widgets_access' );
    23 $widgets_access = get_user_setting( 'widgets_access' );
    24 if ( isset( $_GET['widgets-access'] ) ) {
    24 if ( isset( $_GET['widgets-access'] ) ) {
    25 	check_admin_referer( 'widgets-access' );
    25 	check_admin_referer( 'widgets-access' );
    26 
    26 
    27 	$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
    27 	$widgets_access = 'on' === $_GET['widgets-access'] ? 'on' : 'off';
    28 	set_user_setting( 'widgets_access', $widgets_access );
    28 	set_user_setting( 'widgets_access', $widgets_access );
    29 }
    29 }
    30 
    30 
    31 if ( 'on' == $widgets_access ) {
    31 if ( 'on' === $widgets_access ) {
    32 	add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
    32 	add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
    33 } else {
    33 } else {
    34 	wp_enqueue_script( 'admin-widgets' );
    34 	wp_enqueue_script( 'admin-widgets' );
    35 
    35 
    36 	if ( wp_is_mobile() ) {
    36 	if ( wp_is_mobile() ) {
    52 get_current_screen()->add_help_tab(
    52 get_current_screen()->add_help_tab(
    53 	array(
    53 	array(
    54 		'id'      => 'overview',
    54 		'id'      => 'overview',
    55 		'title'   => __( 'Overview' ),
    55 		'title'   => __( 'Overview' ),
    56 		'content' =>
    56 		'content' =>
    57 				 '<p>' . __( 'Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.' ) . '</p>
    57 				'<p>' . __( 'Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.' ) . '</p>
    58 	<p>' . __( 'The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.' ) . '</p>',
    58 	<p>' . __( 'The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.' ) . '</p>',
    59 	)
    59 	)
    60 );
    60 );
    61 get_current_screen()->add_help_tab(
    61 get_current_screen()->add_help_tab(
    62 	array(
    62 	array(
    63 		'id'      => 'removing-reusing',
    63 		'id'      => 'removing-reusing',
    64 		'title'   => __( 'Removing and Reusing' ),
    64 		'title'   => __( 'Removing and Reusing' ),
    65 		'content' =>
    65 		'content' =>
    66 				 '<p>' . __( 'If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.' ) . '</p>
    66 				'<p>' . __( 'If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.' ) . '</p>
    67 	<p>' . __( 'Widgets may be used multiple times. You can give each widget a title, to display on your site, but it&#8217;s not required.' ) . '</p>
    67 	<p>' . __( 'Widgets may be used multiple times. You can give each widget a title, to display on your site, but it&#8217;s not required.' ) . '</p>
    68 	<p>' . __( 'Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.' ) . '</p>',
    68 	<p>' . __( 'Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.' ) . '</p>',
    69 	)
    69 	)
    70 );
    70 );
    71 get_current_screen()->add_help_tab(
    71 get_current_screen()->add_help_tab(
    72 	array(
    72 	array(
    73 		'id'      => 'missing-widgets',
    73 		'id'      => 'missing-widgets',
    74 		'title'   => __( 'Missing Widgets' ),
    74 		'title'   => __( 'Missing Widgets' ),
    75 		'content' =>
    75 		'content' =>
    76 				 '<p>' . __( 'Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.' ) . '</p>' .
    76 				'<p>' . __( 'Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.' ) . '</p>' .
    77 					 '<p>' . __( 'When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.' ) . '</p>',
    77 					'<p>' . __( 'When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.' ) . '</p>',
    78 	)
    78 	)
    79 );
    79 );
    80 
    80 
    81 get_current_screen()->set_help_sidebar(
    81 get_current_screen()->set_help_sidebar(
    82 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    82 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    83 	'<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Widgets_Screen">Documentation on Widgets</a>' ) . '</p>' .
    83 	'<p>' . __( '<a href="https://wordpress.org/support/article/appearance-widgets-screen/">Documentation on Widgets</a>' ) . '</p>' .
    84 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    84 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    85 );
    85 );
    86 
    86 
    87 if ( ! current_theme_supports( 'widgets' ) ) {
    87 if ( ! current_theme_supports( 'widgets' ) ) {
    88 	wp_die( __( 'The theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="https://codex.wordpress.org/Widgetizing_Themes">follow these instructions</a>.' ) );
    88 	wp_die( __( 'The theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="https://developer.wordpress.org/themes/functionality/widgets/">follow these instructions</a>.' ) );
    89 }
    89 }
    90 
    90 
    91 // These are the widgets grouped by sidebar
    91 // These are the widgets grouped by sidebar.
    92 $sidebars_widgets = wp_get_sidebars_widgets();
    92 $sidebars_widgets = wp_get_sidebars_widgets();
    93 
    93 
    94 if ( empty( $sidebars_widgets ) ) {
    94 if ( empty( $sidebars_widgets ) ) {
    95 	$sidebars_widgets = wp_get_widget_defaults();
    95 	$sidebars_widgets = wp_get_widget_defaults();
    96 }
    96 }
    97 
    97 
    98 foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
    98 foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
    99 	if ( 'wp_inactive_widgets' == $sidebar_id ) {
    99 	if ( 'wp_inactive_widgets' === $sidebar_id ) {
   100 		continue;
   100 		continue;
   101 	}
   101 	}
   102 
   102 
   103 	if ( ! is_registered_sidebar( $sidebar_id ) ) {
   103 	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.
   105 			register_sidebar(
   105 			register_sidebar(
   106 				array(
   106 				array(
   107 					'name'          => __( 'Inactive Sidebar (not used)' ),
   107 					'name'          => __( 'Inactive Sidebar (not used)' ),
   108 					'id'            => $sidebar_id,
   108 					'id'            => $sidebar_id,
   109 					'class'         => 'inactive-sidebar orphan-sidebar',
   109 					'class'         => 'inactive-sidebar orphan-sidebar',
   118 			unset( $sidebars_widgets[ $sidebar_id ] );
   118 			unset( $sidebars_widgets[ $sidebar_id ] );
   119 		}
   119 		}
   120 	}
   120 	}
   121 }
   121 }
   122 
   122 
   123 // register the inactive_widgets area as sidebar
   123 // Register the inactive_widgets area as sidebar.
   124 register_sidebar(
   124 register_sidebar(
   125 	array(
   125 	array(
   126 		'name'          => __( 'Inactive Widgets' ),
   126 		'name'          => __( 'Inactive Widgets' ),
   127 		'id'            => 'wp_inactive_widgets',
   127 		'id'            => 'wp_inactive_widgets',
   128 		'class'         => 'inactive-sidebar',
   128 		'class'         => 'inactive-sidebar',
   134 	)
   134 	)
   135 );
   135 );
   136 
   136 
   137 retrieve_widgets();
   137 retrieve_widgets();
   138 
   138 
   139 // We're saving a widget without js
   139 // We're saving a widget without JS.
   140 if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) {
   140 if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) {
   141 	$widget_id = $_POST['widget-id'];
   141 	$widget_id = $_POST['widget-id'];
   142 	check_admin_referer( "save-delete-widget-$widget_id" );
   142 	check_admin_referer( "save-delete-widget-$widget_id" );
   143 
   143 
   144 	$number = isset( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : '';
   144 	$number = isset( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : '';
   186 	}
   186 	}
   187 
   187 
   188 	$_POST['widget-id'] = $sidebar;
   188 	$_POST['widget-id'] = $sidebar;
   189 
   189 
   190 	foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
   190 	foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
   191 		if ( $name != $id_base || ! is_callable( $control['callback'] ) ) {
   191 		if ( $name !== $id_base || ! is_callable( $control['callback'] ) ) {
   192 			continue;
   192 			continue;
   193 		}
   193 		}
   194 
   194 
   195 		ob_start();
   195 		ob_start();
   196 			call_user_func_array( $control['callback'], $control['params'] );
   196 			call_user_func_array( $control['callback'], $control['params'] );
   214 	wp_set_sidebars_widgets( $sidebars_widgets );
   214 	wp_set_sidebars_widgets( $sidebars_widgets );
   215 	wp_redirect( admin_url( 'widgets.php?message=0' ) );
   215 	wp_redirect( admin_url( 'widgets.php?message=0' ) );
   216 	exit;
   216 	exit;
   217 }
   217 }
   218 
   218 
   219 // Remove inactive widgets without js
   219 // Remove inactive widgets without JS.
   220 if ( isset( $_POST['removeinactivewidgets'] ) ) {
   220 if ( isset( $_POST['removeinactivewidgets'] ) ) {
   221 	check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' );
   221 	check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' );
   222 
   222 
   223 	if ( $_POST['removeinactivewidgets'] ) {
   223 	if ( $_POST['removeinactivewidgets'] ) {
   224 		foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) {
   224 		foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) {
   236 
   236 
   237 	wp_redirect( admin_url( 'widgets.php?message=0' ) );
   237 	wp_redirect( admin_url( 'widgets.php?message=0' ) );
   238 	exit;
   238 	exit;
   239 }
   239 }
   240 
   240 
   241 // Output the widget form without js
   241 // Output the widget form without JS.
   242 if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
   242 if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
   243 	$widget_id = $_GET['editwidget'];
   243 	$widget_id = $_GET['editwidget'];
   244 
   244 
   245 	if ( isset( $_GET['addnew'] ) ) {
   245 	if ( isset( $_GET['addnew'] ) ) {
   246 		// Default to the first sidebar
   246 		// Default to the first sidebar.
   247 		$keys    = array_keys( $wp_registered_sidebars );
   247 		$keys    = array_keys( $wp_registered_sidebars );
   248 		$sidebar = reset( $keys );
   248 		$sidebar = reset( $keys );
   249 
   249 
   250 		if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // multi-widget
   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
   251 			// Copy minimal info from an existing instance of this widget to a new instance.
   252 			foreach ( $wp_registered_widget_controls as $control ) {
   252 			foreach ( $wp_registered_widget_controls as $control ) {
   253 				if ( $_GET['base'] === $control['id_base'] ) {
   253 				if ( $_GET['base'] === $control['id_base'] ) {
   254 					$control_callback                                = $control['callback'];
   254 					$control_callback                                = $control['callback'];
   255 					$multi_number                                    = (int) $_GET['num'];
   255 					$multi_number                                    = (int) $_GET['num'];
   256 					$control['params'][0]['number']                  = -1;
   256 					$control['params'][0]['number']                  = -1;
   257 					$widget_id                                       = $control['id'] = $control['id_base'] . '-' . $multi_number;
   257 					$control['id']                                   = $control['id_base'] . '-' . $multi_number;
       
   258 					$widget_id                                       = $control['id'];
   258 					$wp_registered_widget_controls[ $control['id'] ] = $control;
   259 					$wp_registered_widget_controls[ $control['id'] ] = $control;
   259 					break;
   260 					break;
   260 				}
   261 				}
   261 			}
   262 			}
   262 		}
   263 		}
   285 
   286 
   286 	// Show the widget form.
   287 	// Show the widget form.
   287 	$width = ' style="width:' . max( $control['width'], 350 ) . 'px"';
   288 	$width = ' style="width:' . max( $control['width'], 350 ) . 'px"';
   288 	$key   = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0;
   289 	$key   = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0;
   289 
   290 
   290 	require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
   291 	require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
   291 	<div class="wrap">
   292 	<div class="wrap">
   292 	<h1><?php echo esc_html( $title ); ?></h1>
   293 	<h1><?php echo esc_html( $title ); ?></h1>
   293 	<div class="editwidget"<?php echo $width; ?>>
   294 	<div class="editwidget"<?php echo $width; ?>>
   294 	<h2><?php printf( __( 'Widget %s' ), $name ); ?></h2>
   295 	<h2>
       
   296 	<?php
       
   297 	/* translators: %s: Widget name. */
       
   298 	printf( __( 'Widget %s' ), $name );
       
   299 	?>
       
   300 	</h2>
   295 
   301 
   296 	<form action="widgets.php" method="post">
   302 	<form action="widgets.php" method="post">
   297 	<div class="widget-inside">
   303 	<div class="widget-inside">
   298 	<?php
   304 	<?php
   299 	if ( is_callable( $control_callback ) ) {
   305 	if ( is_callable( $control_callback ) ) {
   308 	<div class="widget-position">
   314 	<div class="widget-position">
   309 	<table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody>
   315 	<table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody>
   310 	<?php
   316 	<?php
   311 	foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
   317 	foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
   312 		echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
   318 		echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
   313 		if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
   319 		if ( 'wp_inactive_widgets' === $sbname || 'orphaned_widgets' === substr( $sbname, 0, 16 ) ) {
   314 			echo '&nbsp;';
   320 			echo '&nbsp;';
   315 		} else {
   321 		} else {
   316 			if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
   322 			if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
   317 				$j                           = 1;
   323 				$j                           = 1;
   318 				$sidebars_widgets[ $sbname ] = array();
   324 				$sidebars_widgets[ $sbname ] = array();
   358 	</div>
   364 	</div>
   359 	</form>
   365 	</form>
   360 	</div>
   366 	</div>
   361 	</div>
   367 	</div>
   362 	<?php
   368 	<?php
   363 	require_once( ABSPATH . 'wp-admin/admin-footer.php' );
   369 	require_once ABSPATH . 'wp-admin/admin-footer.php';
   364 	exit;
   370 	exit;
   365 }
   371 }
   366 
   372 
   367 $messages = array(
   373 $messages = array(
   368 	__( 'Changes saved.' ),
   374 	__( 'Changes saved.' ),
   371 $errors = array(
   377 $errors = array(
   372 	__( 'Error while saving.' ),
   378 	__( 'Error while saving.' ),
   373 	__( 'Error in displaying the widget settings form.' ),
   379 	__( 'Error in displaying the widget settings form.' ),
   374 );
   380 );
   375 
   381 
   376 require_once( ABSPATH . 'wp-admin/admin-header.php' );
   382 require_once ABSPATH . 'wp-admin/admin-header.php';
   377 ?>
   383 ?>
   378 
   384 
   379 <div class="wrap">
   385 <div class="wrap">
   380 <h1 class="wp-heading-inline">
   386 <h1 class="wp-heading-inline">
   381 <?php
   387 <?php
   448 
   454 
   449 <?php
   455 <?php
   450 
   456 
   451 $theme_sidebars = array();
   457 $theme_sidebars = array();
   452 foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
   458 foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
   453 	if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
   459 	if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {
   454 		$wrap_class = 'widgets-holder-wrap';
   460 		$wrap_class = 'widgets-holder-wrap';
   455 		if ( ! empty( $registered_sidebar['class'] ) ) {
   461 		if ( ! empty( $registered_sidebar['class'] ) ) {
   456 			$wrap_class .= ' ' . $registered_sidebar['class'];
   462 			$wrap_class .= ' ' . $registered_sidebar['class'];
   457 		}
   463 		}
   458 
   464 
   459 		$is_inactive_widgets = 'wp_inactive_widgets' == $registered_sidebar['id'];
   465 		$is_inactive_widgets = 'wp_inactive_widgets' === $registered_sidebar['id'];
   460 		?>
   466 		?>
   461 		<div class="<?php echo esc_attr( $wrap_class ); ?>">
   467 		<div class="<?php echo esc_attr( $wrap_class ); ?>">
   462 			<div class="widget-holder inactive">
   468 			<div class="widget-holder inactive">
   463 				<?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
   469 				<?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
   464 
   470 
   496 ?>
   502 ?>
   497 </div>
   503 </div>
   498 </div>
   504 </div>
   499 <?php
   505 <?php
   500 
   506 
   501 $i                    = $split = 0;
   507 $i                    = 0;
       
   508 $split                = 0;
   502 $single_sidebar_class = '';
   509 $single_sidebar_class = '';
   503 $sidebars_count       = count( $theme_sidebars );
   510 $sidebars_count       = count( $theme_sidebars );
   504 
   511 
   505 if ( $sidebars_count > 1 ) {
   512 if ( $sidebars_count > 1 ) {
   506 	$split = ceil( $sidebars_count / 2 );
   513 	$split = (int) ceil( $sidebars_count / 2 );
   507 } else {
   514 } else {
   508 	$single_sidebar_class = ' single-sidebar';
   515 	$single_sidebar_class = ' single-sidebar';
   509 }
   516 }
   510 
   517 
   511 ?>
   518 ?>
   522 
   529 
   523 	if ( $i > 0 ) {
   530 	if ( $i > 0 ) {
   524 		$wrap_class .= ' closed';
   531 		$wrap_class .= ' closed';
   525 	}
   532 	}
   526 
   533 
   527 	if ( $split && $i == $split ) {
   534 	if ( $split && $i === $split ) {
   528 		?>
   535 		?>
   529 		</div><div class="sidebars-column-2">
   536 		</div><div class="sidebars-column-2">
   530 		<?php
   537 		<?php
   531 	}
   538 	}
   532 
   539 
   533 	?>
   540 	?>
   534 	<div class="<?php echo esc_attr( $wrap_class ); ?>">
   541 	<div class="<?php echo esc_attr( $wrap_class ); ?>">
   535 		<?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 		?>
   536 	</div>
   546 	</div>
   537 	<?php
   547 	<?php
   538 
   548 
   539 	$i++;
   549 	$i++;
   540 }
   550 }
   563  * Fires after the available widgets and sidebars have loaded, before the admin footer.
   573  * Fires after the available widgets and sidebars have loaded, before the admin footer.
   564  *
   574  *
   565  * @since 2.2.0
   575  * @since 2.2.0
   566  */
   576  */
   567 do_action( 'sidebar_admin_page' );
   577 do_action( 'sidebar_admin_page' );
   568 require_once( ABSPATH . 'wp-admin/admin-footer.php' );
   578 require_once ABSPATH . 'wp-admin/admin-footer.php';