From 8de3d20dc210c02c2c09b5597b801bd860cc0c1e Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 10 Mar 2010 17:44:32 +0000 Subject: [PATCH] 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 --- wp-admin/options.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wp-admin/options.php b/wp-admin/options.php index c149d86748..a79edc9884 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -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]) )