mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-01 00:27:38 +02:00
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,8 +62,8 @@ 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,
|
||||||
@ -74,6 +74,9 @@ foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
|
|||||||
'before_title' => '',
|
'before_title' => '',
|
||||||
'after_title' => '',
|
'after_title' => '',
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
unset( $sidebars_widgets[ $sidebar_id ] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user