Make WordPress Core

Changeset 16706


Ignore:
Timestamp:
12/03/2010 10:59:20 AM (14 years ago)
Author:
markjaquith
Message:

Backwards compat for plugin use of updated=1. fixes #15660

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r16689 r16706  
    12391239 * pageload and returns them.
    12401240 *
    1241  * If changes were just submitted ($_GET['updated']) and settings errors were saved
     1241 * If changes were just submitted ($_GET['settings-updated']) and settings errors were saved
    12421242 * to the 'settings_errors' transient then those errors will be returned instead. This
    12431243 * is used to pass errors back across pageloads.
     
    12661266    // If settings were passed back from options.php then use them
    12671267    // Ignore transients if $sanitize is true, we dont' want the old values anyway
    1268     if ( isset($_GET['updated']) && $_GET['updated'] && get_transient('settings_errors') ) {
     1268    if ( isset($_GET['settings-updated']) && $_GET['settings-updated'] && get_transient('settings_errors') ) {
    12691269        $settings_errors = get_transient('settings_errors');
    12701270        delete_transient('settings_errors');
     
    13091309function settings_errors( $setting = '', $sanitize = FALSE, $hide_on_update = FALSE ) {
    13101310
    1311     if ($hide_on_update AND $_GET['updated']) return;
     1311    if ($hide_on_update AND $_GET['settings-updated']) return;
    13121312
    13131313    $settings_errors = get_settings_errors( $setting, $sanitize );
  • trunk/wp-admin/options-head.php

    r13177 r16706  
    1212wp_reset_vars(array('action', 'standalone', 'option_group_id'));
    1313
     14if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
     15    // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
     16    add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
     17}
     18
    1419settings_errors();
    1520
  • trunk/wp-admin/options.php

    r16431 r16706  
    158158     * Redirect back to the settings page that was submitted
    159159     */
    160     $goback = add_query_arg( 'updated', 'true',  wp_get_referer() );
     160    $goback = add_query_arg( 'settings-updated', 'true',  wp_get_referer() );
    161161    wp_redirect( $goback );
    162162    exit;
Note: See TracChangeset for help on using the changeset viewer.