Ticket #18088: 18088.3.diff
File 18088.3.diff, 2.2 KB (added by , 9 years ago) |
---|
-
src/wp-admin/includes/template.php
1386 1386 * action hook). 1387 1387 * 1388 1388 * @since 3.0.0 1389 * @since 4.6.0 The function now supports getting network settings errors from a transient. 1389 1390 * 1390 1391 * @global array $wp_settings_errors Storage array of errors registered during this pageload 1391 1392 * … … 1404 1405 if ( $sanitize ) 1405 1406 sanitize_option( $setting, get_option( $setting ) ); 1406 1407 1407 // If settings were passed back from options.php then use them.1408 // If settings were passed back from options.php or network/settings.php then use them. 1408 1409 if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) { 1409 1410 $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) ); 1410 1411 delete_transient( 'settings_errors' ); 1412 } elseif ( is_network_admin() && isset( $_GET['updated'] ) && $_GET['updated'] && get_site_transient( 'settings_errors' ) ) { 1413 $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_site_transient( 'settings_errors' ) ); 1414 delete_site_transient( 'settings_errors' ); 1411 1415 } 1412 1416 1413 1417 // Check global in case errors have been added on this pageload. -
src/wp-admin/network/settings.php
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 } … … 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><?php104 settings_errors(); 98 105 } 99 106 ?> 100 107