diff --git src/wp-includes/widgets.php src/wp-includes/widgets.php
index 5e3431f..5c266e8 100644
|
|
function register_sidebar($args = array()) { |
803 | 803 | |
804 | 804 | $i = count($wp_registered_sidebars) + 1; |
805 | 805 | |
806 | | if ( empty( $args['id'] ) ) { |
807 | | /* translators: %s: the id argument */ |
808 | | _doing_it_wrong( __FUNCTION__, sprintf( __( 'You should set %s in the arguments array.' ), '<code>id</code>' ), '4.2.0' ); |
809 | | } |
| 806 | $id_is_empty = empty( $args['id'] ); |
810 | 807 | |
811 | 808 | $defaults = array( |
812 | 809 | 'name' => sprintf(__('Sidebar %d'), $i ), |
… |
… |
function register_sidebar($args = array()) { |
821 | 818 | |
822 | 819 | $sidebar = wp_parse_args( $args, $defaults ); |
823 | 820 | |
| 821 | if ( $id_is_empty ) { |
| 822 | /* translators: %1$s: the id argument */ |
| 823 | _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 area content.' ), '<code>id</code>', $sidebar['name'], $sidebar['id'] ), '4.2.0' ); |
| 824 | } |
| 825 | |
824 | 826 | $wp_registered_sidebars[$sidebar['id']] = $sidebar; |
825 | 827 | |
826 | 828 | add_theme_support('widgets'); |