WC_Admin_Notices::remove_notice()public staticWC 1.0

Remove a notice from being displayed.

Метод класса: WC_Admin_Notices{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WC_Admin_Notices::remove_notice( $name, $force_save );
$name(строка) (обязательный)
Notice name.
$force_save(true|false)
Force saving inside this method instead of at the 'shutdown'.
По умолчанию: false

Код WC_Admin_Notices::remove_notice() WC 8.7.0

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();
	}
}