$theme_sidebars[ $sidebar ] = $registered_sidebar;
$single_sidebar_class = '';
$sidebars_count = count( $theme_sidebars );
if ( $sidebars_count > 1 ) {
$split = (int) ceil( $sidebars_count / 2 );
$single_sidebar_class = ' single-sidebar';
<div class="widget-liquid-right">
<div id="widgets-right" class="wp-clearfix<?php echo $single_sidebar_class; ?>">
<div class="sidebars-column-1">
foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) {
$wrap_class = 'widgets-holder-wrap';
if ( ! empty( $registered_sidebar['class'] ) ) {
$wrap_class .= ' sidebar-' . $registered_sidebar['class'];
$wrap_class .= ' closed';
if ( $split && $i === $split ) {
</div><div class="sidebars-column-2">
<div class="<?php echo esc_attr( $wrap_class ); ?>">
// Show the control forms for each of the widgets in this sidebar.
wp_list_widget_controls( $sidebar, $registered_sidebar['name'] );
<?php wp_nonce_field( 'save-sidebar-widgets', '_wpnonce_widgets', false ); ?>
<div class="widgets-chooser">
<ul class="widgets-chooser-sidebars"></ul>
<div class="widgets-chooser-actions">
<button class="button widgets-chooser-cancel"><?php _e( 'Cancel' ); ?></button>
<button class="button button-primary widgets-chooser-add"><?php _e( 'Add Widget' ); ?></button>
* Fires after the available widgets and sidebars have loaded, before the admin footer.
do_action( 'sidebar_admin_page' );
require_once ABSPATH . 'wp-admin/admin-footer.php';