Make WordPress Core

Ticket #18088: 18088.diff

File 18088.diff, 1.7 KB (added by flixos90, 10 years ago)

fix for error notices not showing

  • src/wp-admin/includes/template.php

     
    14051405                sanitize_option( $setting, get_option( $setting ) );
    14061406
    14071407        // If settings were passed back from options.php then use them.
    1408         if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) {
     1408        if ( ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] || is_network_admin() && isset( $_GET['updated'] ) && $_GET['updated'] ) && get_transient( 'settings_errors' ) ) {
    14091409                $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) );
    14101410                delete_transient( 'settings_errors' );
    14111411        }
  • src/wp-admin/network/settings.php

     
    8686         */
    8787        do_action( 'update_wpmu_options' );
    8888
     89        // If no settings errors were registered add a general 'updated' message.
     90        if ( !count( get_settings_errors() ) )
     91                add_settings_error( 'general', 'settings_updated', __( 'Options saved.' ), 'updated' );
     92
     93        set_transient( 'settings_errors', get_settings_errors(), 30 );
     94
    8995        wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );
    9096        exit();
    9197}
     
    9399include( ABSPATH . 'wp-admin/admin-header.php' );
    94100
    95101if ( isset( $_GET['updated'] ) ) {
    96         ?><div id="message" class="updated notice is-dismissible"><p><?php _e( 'Options saved.' ) ?></p></div><?php
     102        settings_errors();
    97103}
    98104?>
    99105