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)


Top ↑

Parameters Parameters

$notification

(object) (Required) The notification object.


Top ↑

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;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.