WC_Admin_Notices::remove_notice
Remove a notice from being displayed.
Method of the class: WC_Admin_Notices{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Admin_Notices::remove_notice( $name, $force_save );
- $name(string) (required)
- Notice name.
- $force_save(true|false)
- Force saving inside this method instead of at the
'shutdown'.
Default:false
WC_Admin_Notices::remove_notice() WC Admin Notices::remove notice code WC 10.8.1
public static function remove_notice( $name, $force_save = false ) {
if ( self::has_notice( $name ) ) {
self::set_notices( array_diff( self::get_notices(), array( $name ) ) );
}
if ( $force_save ) {
// Adding early save to prevent more race conditions with notices.
self::store_notices();
}
}