Make WordPress Core

Ticket #28672: 28672.3.diff

File 28672.3.diff, 1.2 KB (added by DrewAPicture, 9 years ago)

_doing_it_wrong()

  • src/wp-admin/includes/template.php

     
    13131313function do_settings_sections( $page ) {
    13141314        global $wp_settings_sections, $wp_settings_fields;
    13151315
    1316         if ( ! isset( $wp_settings_sections[$page] ) )
    1317                 return;
     1316        if ( ! isset( $wp_settings_sections[$page] ) ) {
     1317                /* translators: settings page slug */
     1318                $message = sprintf( __( "The '%s' settings page is not defined." ), $page );
     1319                _doing_it_wrong( __FUNCTION__, $message, '4.4' );
     1320        }
    13181321
    13191322        foreach ( (array) $wp_settings_sections[$page] as $section ) {
    13201323                if ( $section['title'] )
     
    13481351function do_settings_fields($page, $section) {
    13491352        global $wp_settings_fields;
    13501353
    1351         if ( ! isset( $wp_settings_fields[$page][$section] ) )
    1352                 return;
     1354        if ( ! isset( $wp_settings_fields[$page][$section] ) ) {
     1355                /* translators: settings section slug */
     1356                $message = sprintf( __( "The '%s' settings section is not defined." ), $section );
     1357                _doing_it_wrong( __FUNCTION__, $message, '4.4' );
     1358        }
    13531359
    13541360        foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
    13551361                $class = '';