Make WordPress Core

Changeset 13785


Ignore:
Timestamp:
03/21/2010 01:49:00 AM (15 years ago)
Author:
nacin
Message:

Simplify the deprecated notice for unregistered settings. fixes #11730

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options.php

    r13746 r13785  
    105105        wp_die( __( 'Error: options page not found.' ) );
    106106
    107     if ( 'options' == $option_page ) {
     107    if ( $unregistered = ( 'options' == $option_page ) ) {
    108108        if ( is_multisite() && ! is_super_admin() )
    109109            wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) );
     
    128128
    129129    if ( $options ) {
    130         if ( is_array( $whitelist_options[ $option_page ] ) ) {
    131             $registered = $whitelist_options[ $option_page ];
    132             $whitelist_check = true;
    133         } else {
    134             $whitelist_check = false;
    135             _deprecated_argument( 'options.php', '2.7', __( 'Unregistered settings are deprecated. Register your theme/plugin settings.' ) );
    136         }
    137130        foreach ( $options as $option ) {
    138             if ( $whitelist_check && !in_array( $option, $registered ) ) {
    139                 _deprecated_argument( 'options.php', '2.7', __( 'Unregistered settings are deprecated. Register your theme/plugin settings.' ) );
    140                 $whitelist_check = false;
    141             }
     131            if ( $unregistered )
     132                _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 ) );
     133
    142134            $option = trim($option);
    143135            $value = null;
Note: See TracChangeset for help on using the changeset viewer.