WC_Admin_Notices::add_notice( string $name, bool $force_save = false )
Show a notice.
Description Description
Parameters Parameters
- $name
-
(Required) Notice name.
- $force_save
-
(Optional) Force saving inside this method instead of at the 'shutdown'.
Default value: false
Source Source
File: includes/admin/class-wc-admin-notices.php
public static function add_notice( $name, $force_save = false ) { self::$notices = array_unique( array_merge( self::get_notices(), array( $name ) ) ); if ( $force_save ) { // Adding early save to prevent more race conditions with notices. self::store_notices(); } }