diff --git src/wp-admin/includes/template.php src/wp-admin/includes/template.php
index 4eac951..48c4802 100644
|
|
function add_settings_error( $setting, $code, $message, $type = 'error' ) { |
1394 | 1394 | * action hook). |
1395 | 1395 | * |
1396 | 1396 | * @since 3.0.0 |
| 1397 | * @since 4.7.0 The function now supports getting network settings errors from a transient. |
1397 | 1398 | * |
1398 | 1399 | * @global array $wp_settings_errors Storage array of errors registered during this pageload |
1399 | 1400 | * |
… |
… |
function get_settings_errors( $setting = '', $sanitize = false ) { |
1412 | 1413 | if ( $sanitize ) |
1413 | 1414 | sanitize_option( $setting, get_option( $setting ) ); |
1414 | 1415 | |
1415 | | // If settings were passed back from options.php then use them. |
| 1416 | // If settings were passed back from options.php or network/settings.php then use them. |
1416 | 1417 | if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) { |
1417 | 1418 | $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) ); |
1418 | 1419 | delete_transient( 'settings_errors' ); |
| 1420 | } elseif ( is_network_admin() && isset( $_GET['updated'] ) && $_GET['updated'] && get_site_transient( 'settings_errors' ) ) { |
| 1421 | $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_site_transient( 'settings_errors' ) ); |
| 1422 | delete_site_transient( 'settings_errors' ); |
1419 | 1423 | } |
1420 | 1424 | |
1421 | 1425 | // Check global in case errors have been added on this pageload. |
diff --git src/wp-admin/network/settings.php src/wp-admin/network/settings.php
index d1af88b..8be01ce 100644
|
|
if ( $_POST ) { |
87 | 87 | */ |
88 | 88 | do_action( 'update_wpmu_options' ); |
89 | 89 | |
| 90 | // If no settings errors were registered, add a general 'updated' message. |
| 91 | if ( ! count( get_settings_errors() ) ) { |
| 92 | add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' ); |
| 93 | } |
| 94 | |
| 95 | set_site_transient( 'settings_errors', get_settings_errors(), 30 ); |
| 96 | |
90 | 97 | wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) ); |
91 | 98 | exit(); |
92 | 99 | } |
… |
… |
if ( $_POST ) { |
94 | 101 | include( ABSPATH . 'wp-admin/admin-header.php' ); |
95 | 102 | |
96 | 103 | if ( isset( $_GET['updated'] ) ) { |
97 | | ?><div id="message" class="updated notice is-dismissible"><p><?php _e( 'Settings saved.' ) ?></p></div><?php |
| 104 | settings_errors(); |
98 | 105 | } |
99 | 106 | ?> |
100 | 107 | |