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

git-svn-id: http://svn.automattic.com/wordpress/trunk@13646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-03-10 17:44:32 +00:00
parent 0cbe9fd4c1
commit c1b0c8e8c9
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]) )