Prevent errors in assigning widgets to sidebars for themes with dynamic sidebars, props batmoo, fixes #19274
git-svn-id: http://svn.automattic.com/wordpress/trunk@19334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
83e2ae14d4
commit
2d6d3c748a
|
@ -62,18 +62,21 @@ foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
|
||||||
if ( 'wp_inactive_widgets' == $sidebar_id )
|
if ( 'wp_inactive_widgets' == $sidebar_id )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( empty( $wp_registered_sidebars[ $sidebar_id ] ) && ! empty( $widgets ) ) {
|
if ( !isset( $wp_registered_sidebars[ $sidebar_id ] ) ) {
|
||||||
// register the inactive_widgets area as sidebar
|
if ( ! empty( $widgets ) ) { // register the inactive_widgets area as sidebar
|
||||||
register_sidebar(array(
|
register_sidebar(array(
|
||||||
'name' => __( 'Inactive Sidebar (from previous theme)' ),
|
'name' => __( 'Inactive Sidebar (from previous theme)' ),
|
||||||
'id' => $sidebar_id,
|
'id' => $sidebar_id,
|
||||||
'class' => 'inactive-sidebar orphan-sidebar',
|
'class' => 'inactive-sidebar orphan-sidebar',
|
||||||
'description' => __( 'This is a left over sidebar from an old theme and does not show anywhere on your site' ),
|
'description' => __( 'This is a left over sidebar from an old theme and does not show anywhere on your site' ),
|
||||||
'before_widget' => '',
|
'before_widget' => '',
|
||||||
'after_widget' => '',
|
'after_widget' => '',
|
||||||
'before_title' => '',
|
'before_title' => '',
|
||||||
'after_title' => '',
|
'after_title' => '',
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
unset( $sidebars_widgets[ $sidebar_id ] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue