Automattic\WooCommerce\Internal\PushNotifications\Notifications
Notification::should_send_to_user
Deprecated since 1.3.0. It is no longer supported and may be removed in future releases. Use
get_suppression_reason() instead.Whether this notification should be delivered to a user.
Kept so a request that loaded older code during a plugin update does not fatal on a call that has moved. Nothing in the plugin calls it; use {@see get_suppression_reason()}, which also names why not.
Method of the class: Notification{}
No Hooks.
Returns
bool.
Usage
$Notification = new Notification(); $Notification->should_send_to_user( $pref_value ): bool;
- $pref_value(mixed) (required)
- The user's stored preference value, or null.
Changelog
| Since 10.9.0 | Introduced. |
| Deprecated since 11.3.0 | Use get_suppression_reason() instead. |
Notification::should_send_to_user() Notification::should send to user code WC 11.3.0
public function should_send_to_user( $pref_value ): bool {
return null === $this->get_suppression_reason( $pref_value );
}