Gocodebox_Banner_Notifier::should_hide_notification( object $notification )
Check a notification to see if we should hide it based on the rules set.
Description Description
Hides if ANY rule is true. (OR)
Parameters Parameters
- $notification
-
(object) (Required) The notification object.
Source Source
File: libraries/banner-notifications/src/notifications.php
function should_hide_notification( $notification ) {
// default to NOT hiding.
$hide = false;
if ( ! empty( $notification->hide_if ) ) {
foreach ( $notification->hide_if as $test => $data ) {
$test_filter = $this->prefix . '_notification_test_' . $test;
$hide = apply_filters( $test_filter, false, $data );
if ( $hide ) {
// one test passes, let's hide
break;
}
}
}
return $hide;
}
Expand full source code Collapse full source code View on GitHub