From c1b0c8e8c903e9a03bd48849d01661f10461dea0 Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Wed, 10 Mar 2010 17:44:32 +0000 Subject: [PATCH] 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 --- wp-admin/options.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wp-admin/options.php b/wp-admin/options.php index c149d8674..a79edc988 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]) )