diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index d8d82a0..19a38bc 100644
|
|
|
function add_settings_section($id, $title, $callback, $page) { |
| 1072 | 1072 | $page = 'reading'; |
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | | if ( !isset($wp_settings_sections) ) |
| 1076 | | $wp_settings_sections = array(); |
| 1077 | | if ( !isset($wp_settings_sections[$page]) ) |
| 1078 | | $wp_settings_sections[$page] = array(); |
| 1079 | | if ( !isset($wp_settings_sections[$page][$id]) ) |
| 1080 | | $wp_settings_sections[$page][$id] = array(); |
| 1081 | | |
| 1082 | 1075 | $wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); |
| 1083 | 1076 | } |
| 1084 | 1077 | |
| … |
… |
function add_settings_field($id, $title, $callback, $page, $section = 'default', |
| 1117 | 1110 | $page = 'reading'; |
| 1118 | 1111 | } |
| 1119 | 1112 | |
| 1120 | | if ( !isset($wp_settings_fields) ) |
| 1121 | | $wp_settings_fields = array(); |
| 1122 | | if ( !isset($wp_settings_fields[$page]) ) |
| 1123 | | $wp_settings_fields[$page] = array(); |
| 1124 | | if ( !isset($wp_settings_fields[$page][$section]) ) |
| 1125 | | $wp_settings_fields[$page][$section] = array(); |
| 1126 | | |
| 1127 | 1113 | $wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args); |
| 1128 | 1114 | } |
| 1129 | 1115 | |
| … |
… |
function add_settings_field($id, $title, $callback, $page, $section = 'default', |
| 1143 | 1129 | function do_settings_sections( $page ) { |
| 1144 | 1130 | global $wp_settings_sections, $wp_settings_fields; |
| 1145 | 1131 | |
| 1146 | | if ( ! isset( $wp_settings_sections ) || !isset( $wp_settings_sections[$page] ) ) |
| | 1132 | if ( ! isset( $wp_settings_sections[$page] ) ) |
| 1147 | 1133 | return; |
| 1148 | 1134 | |
| 1149 | 1135 | foreach ( (array) $wp_settings_sections[$page] as $section ) { |
| … |
… |
function do_settings_sections( $page ) { |
| 1178 | 1164 | function do_settings_fields($page, $section) { |
| 1179 | 1165 | global $wp_settings_fields; |
| 1180 | 1166 | |
| 1181 | | if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) ) |
| | 1167 | if ( ! isset( $wp_settings_fields[$page][$section] ) ) |
| 1182 | 1168 | return; |
| 1183 | 1169 | |
| 1184 | 1170 | foreach ( (array) $wp_settings_fields[$page][$section] as $field ) { |
| … |
… |
function do_settings_fields($page, $section) { |
| 1219 | 1205 | function add_settings_error( $setting, $code, $message, $type = 'error' ) { |
| 1220 | 1206 | global $wp_settings_errors; |
| 1221 | 1207 | |
| 1222 | | if ( !isset($wp_settings_errors) ) |
| 1223 | | $wp_settings_errors = array(); |
| 1224 | | |
| 1225 | 1208 | $new_error = array( |
| 1226 | 1209 | 'setting' => $setting, |
| 1227 | 1210 | 'code' => $code, |