diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index 788a4bd..10455cd 100644
|
|
function add_settings_section($id, $title, $callback, $page) { |
1001 | 1001 | $page = 'reading'; |
1002 | 1002 | } |
1003 | 1003 | |
1004 | | if ( !isset($wp_settings_sections) ) |
1005 | | $wp_settings_sections = array(); |
1006 | | if ( !isset($wp_settings_sections[$page]) ) |
1007 | | $wp_settings_sections[$page] = array(); |
1008 | | if ( !isset($wp_settings_sections[$page][$id]) ) |
1009 | | $wp_settings_sections[$page][$id] = array(); |
1010 | | |
1011 | 1004 | $wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); |
1012 | 1005 | } |
1013 | 1006 | |
… |
… |
function add_settings_field($id, $title, $callback, $page, $section = 'default', |
1046 | 1039 | $page = 'reading'; |
1047 | 1040 | } |
1048 | 1041 | |
1049 | | if ( !isset($wp_settings_fields) ) |
1050 | | $wp_settings_fields = array(); |
1051 | | if ( !isset($wp_settings_fields[$page]) ) |
1052 | | $wp_settings_fields[$page] = array(); |
1053 | | if ( !isset($wp_settings_fields[$page][$section]) ) |
1054 | | $wp_settings_fields[$page][$section] = array(); |
1055 | | |
1056 | 1042 | $wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args); |
1057 | 1043 | } |
1058 | 1044 | |
… |
… |
function add_settings_field($id, $title, $callback, $page, $section = 'default', |
1072 | 1058 | function do_settings_sections( $page ) { |
1073 | 1059 | global $wp_settings_sections, $wp_settings_fields; |
1074 | 1060 | |
1075 | | if ( ! isset( $wp_settings_sections ) || !isset( $wp_settings_sections[$page] ) ) |
| 1061 | if ( !isset( $wp_settings_sections[$page] ) ) |
1076 | 1062 | return; |
1077 | 1063 | |
1078 | 1064 | foreach ( (array) $wp_settings_sections[$page] as $section ) { |
… |
… |
function do_settings_sections( $page ) { |
1107 | 1093 | function do_settings_fields($page, $section) { |
1108 | 1094 | global $wp_settings_fields; |
1109 | 1095 | |
1110 | | if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) ) |
| 1096 | if ( !isset($wp_settings_fields[$page][$section]) ) |
1111 | 1097 | return; |
1112 | 1098 | |
1113 | 1099 | foreach ( (array) $wp_settings_fields[$page][$section] as $field ) { |
… |
… |
function do_settings_fields($page, $section) { |
1148 | 1134 | function add_settings_error( $setting, $code, $message, $type = 'error' ) { |
1149 | 1135 | global $wp_settings_errors; |
1150 | 1136 | |
1151 | | if ( !isset($wp_settings_errors) ) |
1152 | | $wp_settings_errors = array(); |
1153 | | |
1154 | 1137 | $new_error = array( |
1155 | 1138 | 'setting' => $setting, |
1156 | 1139 | 'code' => $code, |