WC_Admin_Notices::remove_notice( string $name, bool $force_save = false )

Remove a notice from being displayed.


Description Description


Parameters Parameters

$name

(Required) Notice name.

$force_save

(Optional) Force saving inside this method instead of at the 'shutdown'.

Default value: false


Top ↑

Source Source

File: includes/admin/class-wc-admin-notices.php

	public static function remove_notice( $name, $force_save = false ) {
		self::$notices = array_diff( self::get_notices(), array( $name ) );
		delete_option( 'woocommerce_admin_notice_' . $name );

		if ( $force_save ) {
			// Adding early save to prevent more race conditions with notices.
			self::store_notices();
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.