Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Model_Popup::get_event_count( string $event = 'open', string $which = 'current' )

Get a popups event count.


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Parameters Parameters

$event

(Optional)

Default value: 'open'

$which

(Optional)

Default value: 'current'


Top ↑

Return Return

(int)


Top ↑

Source Source

File: classes/Model/Popup.php

	public function get_event_count( $event = 'open', $which = 'current' ) {
		switch ( $which ) {
			case 'current':
				$current = $this->get_meta( "popup_{$event}_count" );

				// Save future queries by inserting a valid count.
				if ( $current === false || ! is_numeric( $current ) ) {
					$current = 0;
					$this->update_meta( "popup_{$event}_count", $current );
				}

				return absint( $current );
			case 'total':
				$total = $this->get_meta( "popup_{$event}_count_total" );

				// Save future queries by inserting a valid count.
				if ( $total === false || ! is_numeric( $total ) ) {
					$total = 0;
					$this->update_meta( "popup_{$event}_count_total", $total );
				}

				return absint( $total );
		}

		return 0;
	}


Top ↑

User Contributed Notes User Contributed Notes

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