mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user