$wp_settings_error ) { if ( ! $this->is_settings_updated_notification( $wp_settings_error ) ) { continue; } self::$settings_saved = true; unset( $wp_settings_errors[ $key ] ); // Overwrite the global with the list excluding the Changed saved message. $GLOBALS['wp_settings_errors'] = $wp_settings_errors; break; } } /** * Checks whether the settings notification is a settings_updated notification. * * @param array $wp_settings_error The settings object. * * @return bool Whether this is a settings updated settings notification. */ public function is_settings_updated_notification( $wp_settings_error ) { return ! empty( $wp_settings_error['code'] ) && $wp_settings_error['code'] === 'settings_updated'; } /** * Get whether the settings have successfully been saved * * @return bool Whether the settings have successfully been saved. */ public function have_settings_been_saved() { return self::$settings_saved; } /** * Renders a success message if the Yoast SEO settings have been saved. */ public function show_success_message() { if ( $this->have_settings_been_saved() ) { echo '

', esc_html__( 'Settings saved.', 'wordpress-seo' ), '

'; } } }