Simplify the deprecated notice for unregistered settings. fixes #11730

git-svn-id: http://svn.automattic.com/wordpress/trunk@13785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-03-21 01:49:00 +00:00
parent 6ff82f54e7
commit adf8dd3743
1 changed files with 4 additions and 12 deletions

View File

@ -104,7 +104,7 @@ if ( 'update' == $action ) {
if ( !isset( $whitelist_options[ $option_page ] ) )
wp_die( __( 'Error: options page not found.' ) );
if ( 'options' == $option_page ) {
if ( $unregistered = ( 'options' == $option_page ) ) {
if ( is_multisite() && ! is_super_admin() )
wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) );
$options = explode( ',', stripslashes( $_POST[ 'page_options' ] ) );
@ -127,18 +127,10 @@ 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.7', __( '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.7', __( 'Unregistered settings are deprecated. Register your theme/plugin settings.' ) );
$whitelist_check = false;
}
if ( $unregistered )
_deprecated_argument( 'options.php', '2.7', sprintf( __( 'The "%1$s" setting is unregistered. Unregistered settings are deprecated. See http://codex.wordpress.org/Settings_API' ), $option, $option_page ) );
$option = trim($option);
$value = null;
if ( isset($_POST[$option]) )