Tribe__Admin__Notices::dismiss( string $slug, int|null $user_id = null )
A Method to actually add the Meta value telling that this notice has been dismissed
Contents
Parameters
- $slug
-
(string) (Required) The Name of the Notice
- $user_id
-
(int|null) (Optional) The user ID
Default value: null
Return
(boolean)
Source
File: src/Tribe/Admin/Notices.php
public function dismiss( $slug, $user_id = null ) {
if ( is_null( $user_id ) ) {
$user_id = get_current_user_id();
}
// If this user has dimissed we don't care either
if ( $this->has_user_dimissed( $slug, $user_id ) ) {
return true;
}
return add_user_meta( $user_id, self::$meta_key, $slug, false );
}
Changelog
| Version | Description |
|---|---|
| 4.3 | Introduced. |