Simplify the deprecated notice for unregistered settings. fixes #11730

git-svn-id: https://develop.svn.wordpress.org/trunk@13785 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-03-21 01:49:00 +00:00
parent f24da9abad
commit ef46c26f1b

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]) )