Make WordPress Core

Ticket #17884: 17884.diff

File 17884.diff, 2.0 KB (added by scribu, 13 years ago)
  • wp-admin/includes/template.php

     
    10931093                $page = 'general';
    10941094        }
    10951095
    1096         if ( !isset($wp_settings_sections) )
    1097                 $wp_settings_sections = array();
    1098         if ( !isset($wp_settings_sections[$page]) )
    1099                 $wp_settings_sections[$page] = array();
    1100         if ( !isset($wp_settings_sections[$page][$id]) )
    1101                 $wp_settings_sections[$page][$id] = array();
    1102 
    11031096        $wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
    11041097}
    11051098
     
    11331126                $page = 'general';
    11341127        }
    11351128
    1136         if ( !isset($wp_settings_fields) )
    1137                 $wp_settings_fields = array();
    1138         if ( !isset($wp_settings_fields[$page]) )
    1139                 $wp_settings_fields[$page] = array();
    1140         if ( !isset($wp_settings_fields[$page][$section]) )
    1141                 $wp_settings_fields[$page][$section] = array();
    1142 
    11431129        $wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args);
    11441130}
    11451131
     
    11591145function do_settings_sections($page) {
    11601146        global $wp_settings_sections, $wp_settings_fields;
    11611147
    1162         if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) )
     1148        if ( !isset($wp_settings_sections[$page]) )
    11631149                return;
    11641150
    11651151        foreach ( (array) $wp_settings_sections[$page] as $section ) {
     
    11901176function do_settings_fields($page, $section) {
    11911177        global $wp_settings_fields;
    11921178
    1193         if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) )
     1179        if ( !isset($wp_settings_fields[$page][$section]) )
    11941180                return;
    11951181
    11961182        foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
     
    12311217function add_settings_error( $setting, $code, $message, $type = 'error' ) {
    12321218        global $wp_settings_errors;
    12331219
    1234         if ( !isset($wp_settings_errors) )
    1235                 $wp_settings_errors = array();
    1236 
    12371220        $new_error = array(
    12381221                'setting' => $setting,
    12391222                'code' => $code,