| @@ -410,8 +410,22 @@ | ||
| 410 | 410 | } |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | /** |
| 414 | + * `options.php` is what registers the "Settings saved." notice and stores it in the | |
| 415 | + * `settings_errors` transient. We bypass it on network installations, so do it here. | |
| 416 | + * | |
| 417 | + * The guard mirrors core: a success notice is only queued when nothing else has | |
| 418 | + * reported a problem during this request, so a real error from another plugin is | |
| 419 | + * never contradicted by a "Settings saved." underneath it. | |
| 420 | + */ | |
| 421 | + if ( ! count( get_settings_errors() ) ) { | |
| 422 | + add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' ); | |
| 423 | + } | |
| 424 | + | |
| 425 | + set_transient( 'settings_errors', get_settings_errors(), 30 ); | |
| 426 | + | |
| 427 | + /** | |
| 414 | 428 | * Redirect back to the settings page that was submitted. |
| 415 | 429 | */ |
| 416 | 430 | imagify_maybe_redirect( false, [ 'settings-updated' => 'true' ] ); |
| 417 | 431 | } |