Changeset 48477 for trunk/src/wp-includes/option.php
- Timestamp:
- 07/14/2020 12:31:22 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r48321 r48477 2124 2124 * @since 2.7.0 2125 2125 * @since 4.7.0 `$args` can be passed to set flags on the setting, similar to `register_meta()`. 2126 * 2127 * @global array $new_whitelist_options 2126 * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`. 2127 * Please consider writing more inclusive code. 2128 * 2129 * @global array $new_allowed_options 2128 2130 * @global array $wp_registered_settings 2129 2131 * … … 2146 2148 */ 2147 2149 function register_setting( $option_group, $option_name, $args = array() ) { 2148 global $new_whitelist_options, $wp_registered_settings; 2150 global $new_allowed_options, $wp_registered_settings; 2151 2152 /* 2153 * In 5.5.0, the `$new_whitelist_options` global variable was renamed to `$new_allowed_options`. 2154 * Please consider writing more inclusive code. 2155 */ 2156 $GLOBALS['new_whitelist_options'] = &$new_allowed_options; 2149 2157 2150 2158 $defaults = array( … … 2212 2220 } 2213 2221 2214 $new_ whitelist_options[ $option_group ][] = $option_name;2222 $new_allowed_options[ $option_group ][] = $option_name; 2215 2223 2216 2224 if ( ! empty( $args['sanitize_callback'] ) ) { … … 2240 2248 * @since 2.7.0 2241 2249 * @since 4.7.0 `$sanitize_callback` was deprecated. The callback from `register_setting()` is now used instead. 2242 * 2243 * @global array $new_whitelist_options 2250 * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`. 2251 * Please consider writing more inclusive code. 2252 * 2253 * @global array $new_allowed_options 2244 2254 * @global array $wp_registered_settings 2245 2255 * … … 2249 2259 */ 2250 2260 function unregister_setting( $option_group, $option_name, $deprecated = '' ) { 2251 global $new_whitelist_options, $wp_registered_settings; 2261 global $new_allowed_options, $wp_registered_settings; 2262 2263 /* 2264 * In 5.5.0, the `$new_whitelist_options` global variable was renamed to `$new_allowed_options`. 2265 * Please consider writing more inclusive code. 2266 */ 2267 $GLOBALS['new_whitelist_options'] = &$new_allowed_options; 2252 2268 2253 2269 if ( 'misc' === $option_group ) { … … 2277 2293 } 2278 2294 2279 $pos = array_search( $option_name, (array) $new_ whitelist_options[ $option_group ], true );2295 $pos = array_search( $option_name, (array) $new_allowed_options[ $option_group ], true ); 2280 2296 2281 2297 if ( false !== $pos ) { 2282 unset( $new_ whitelist_options[ $option_group ][ $pos ] );2298 unset( $new_allowed_options[ $option_group ][ $pos ] ); 2283 2299 } 2284 2300
Note: See TracChangeset
for help on using the changeset viewer.