diff --git a/wp-includes/version.php b/wp-includes/version.php index 5e09b54978..b034b43ee6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta4-32109'; +$wp_version = '4.2-beta4-32110'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 5e3431ff10..67282a9b3c 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -803,10 +803,7 @@ function register_sidebar($args = array()) { $i = count($wp_registered_sidebars) + 1; - if ( empty( $args['id'] ) ) { - /* translators: %s: the id argument */ - _doing_it_wrong( __FUNCTION__, sprintf( __( 'You should set %s in the arguments array.' ), 'id' ), '4.2.0' ); - } + $id_is_empty = empty( $args['id'] ); $defaults = array( 'name' => sprintf(__('Sidebar %d'), $i ), @@ -821,6 +818,11 @@ function register_sidebar($args = array()) { $sidebar = wp_parse_args( $args, $defaults ); + if ( $id_is_empty ) { + /* translators: %1$s: the id argument */ + _doing_it_wrong( __FUNCTION__, sprintf( __( 'No %1$s was set in the arguments array for the "%2$s" sidebar. Defaulting to "%3$s". Manually set the %1$s to "%3$s" to silence this notice and keep existing sidebar content.' ), 'id', $sidebar['name'], $sidebar['id'] ), '4.2.0' ); + } + $wp_registered_sidebars[$sidebar['id']] = $sidebar; add_theme_support('widgets');