Tribe__Events__Aggregator__Service::get_limit( string $type, boolean $ignore_cache = false )

Returns usage limits


Parameters

$type

(string) (Required) Type of limits to return

$ignore_cache

(boolean) (Optional) Whether or not cache should be ignored when fetching the value

Default value: false


Top ↑

Return

(array|int) Either an array detailing the limit information (used, remaining) or 0 if the limit for the specified type could not be determined.


Top ↑

Source

File: src/Tribe/Aggregator/Service.php

	public function get_limit( $type, $ignore_cache = false ) {
		if ( false === $this->origins || $ignore_cache ) {
			$this->origins = ( (object) $this->get_origins() );
		}

		if ( ! isset( $this->origins->limit->$type ) ) {
			return 0;
		}

		return $this->origins->limit->$type;
	}