Ticket #17884: 17884.diff
File 17884.diff, 2.0 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/template.php
1093 1093 $page = 'general'; 1094 1094 } 1095 1095 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 1103 1096 $wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); 1104 1097 } 1105 1098 … … 1133 1126 $page = 'general'; 1134 1127 } 1135 1128 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 1143 1129 $wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args); 1144 1130 } 1145 1131 … … 1159 1145 function do_settings_sections($page) { 1160 1146 global $wp_settings_sections, $wp_settings_fields; 1161 1147 1162 if ( !isset($wp_settings_sections ) || !isset($wp_settings_sections[$page]) )1148 if ( !isset($wp_settings_sections[$page]) ) 1163 1149 return; 1164 1150 1165 1151 foreach ( (array) $wp_settings_sections[$page] as $section ) { … … 1190 1176 function do_settings_fields($page, $section) { 1191 1177 global $wp_settings_fields; 1192 1178 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]) ) 1194 1180 return; 1195 1181 1196 1182 foreach ( (array) $wp_settings_fields[$page][$section] as $field ) { … … 1231 1217 function add_settings_error( $setting, $code, $message, $type = 'error' ) { 1232 1218 global $wp_settings_errors; 1233 1219 1234 if ( !isset($wp_settings_errors) )1235 $wp_settings_errors = array();1236 1237 1220 $new_error = array( 1238 1221 'setting' => $setting, 1239 1222 'code' => $code,