Make WordPress Core

Ticket #31675: 31675.6.diff

File 31675.6.diff, 1.1 KB (added by DrewAPicture, 10 years ago)

Adjusted string

  • src/wp-includes/widgets.php

     
    803803
    804804        $i = count($wp_registered_sidebars) + 1;
    805805
    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'] );
    810807
    811808        $defaults = array(
    812809                'name' => sprintf(__('Sidebar %d'), $i ),
     
    821818
    822819        $sidebar = wp_parse_args( $args, $defaults );
    823820
     821        if ( $id_is_empty ) {
     822                /* translators: 1: the id argument, 2: sidebar name, 3: sidebar id */
     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 content.' ), '<code>id</code>', $sidebar['name'], $sidebar['id'] ), '4.2.0' );
     824        }
     825
    824826        $wp_registered_sidebars[$sidebar['id']] = $sidebar;
    825827
    826828        add_theme_support('widgets');