Automattic\WooCommerce\Gateways\PayPal
Notices::is_notice_dismissed
Check if the notice has been dismissed.
User meta keys for notice dismissals:
- dismissed_paypal_migration_completed_notice
- dismissed_paypal_account_restricted_notice
- dismissed_paypal_unsupported_currency_notice
The meta keys are set by WC_Admin_Notices when the notice is dismissed by the user.
Method of the class: Notices{}
No Hooks.
Returns
true|false.
Usage
// private - for code of main (parent) class only $result = $this->is_notice_dismissed( $notice_name ): bool;
- $notice_name(string) (required)
- The name of the notice.
Changelog
| Since 10.5.0 | Introduced. |
Notices::is_notice_dismissed() Notices::is notice dismissed code WC 10.7.0
private function is_notice_dismissed( string $notice_name ): bool {
return (bool) get_user_meta( get_current_user_id(), 'dismissed_' . $notice_name . '_notice', true );
}