Widgets: add a function, is_registered_sidebar() - helps us avoid touching the $wp_registered_sidebars global.

Props GaryJ, wonderboymusic.
Fixes #24878.


git-svn-id: https://develop.svn.wordpress.org/trunk@35102 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-10-13 01:32:27 +00:00
parent 9f551a4630
commit 3616fe5939
3 changed files with 25 additions and 12 deletions
+2 -2
View File
@@ -89,7 +89,7 @@ foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
if ( 'wp_inactive_widgets' == $sidebar_id )
continue;
if ( !isset( $wp_registered_sidebars[ $sidebar_id ] ) ) {
if ( ! is_registered_sidebar( $sidebar_id ) ) {
if ( ! empty( $widgets ) ) { // register the inactive_widgets area as sidebar
register_sidebar(array(
'name' => __( 'Inactive Sidebar (not used)' ),
@@ -155,7 +155,7 @@ if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) {
/**
* Fires immediately after a widget has been marked for deletion.
*
*
* @since 4.4.0
*
* @param string $widget_id ID of the widget marked for deletion.