Display a warning when processing an unregistered setting, see #11730

git-svn-id: https://develop.svn.wordpress.org/trunk@13646 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ron Rennick 2010-03-10 17:44:32 +00:00
parent c466a4bf82
commit 8de3d20dc2
1 changed files with 11 additions and 0 deletions

View File

@ -120,7 +120,18 @@ if ( 'update' == $action ) {
}
if ( $options ) {
if ( is_array( $whitelist_options[ $option_page ] ) ) {
$registered = $whitelist_options[ $option_page ];
$whitelist_check = true;
} else {
$whitelist_check = false;
_deprecated_argument( 'options.php', '2.6', __( 'Unregistered settings are deprecated. Register your theme/plugin settings.' ) );
}
foreach ( $options as $option ) {
if ( $whitelist_check && !in_array( $option, $registered ) ) {
_deprecated_argument( 'options.php', '2.6', __( 'Unregistered settings are deprecated. Register your theme/plugin settings.' ) );
$whitelist_check = false;
}
$option = trim($option);
$value = null;
if ( isset($_POST[$option]) )