Tribe__Events__Aggregator__API__Origins::get_limit( string $type = 'import' )

Get origin limit values for an operation.


Parameters

$type

(string) (Optional) Type of operation limit to retrieve; defaults to import.

Default value: 'import'


Top ↑

Return

(int) The numeric limit (how many times) applied to the operation.


Top ↑

Source

File: src/Tribe/Aggregator/API/Origins.php

	public function get_limit( $type = 'import' ) {
		$cached_limit_settings = get_transient( "{$this->cache_group}_origin_limit" );
		if ( $cached_limit_settings && isset( $cached_limit_settings->$type ) ) {
			return (int) $cached_limit_settings->$type;
		}

		$service_origins = $this->fetch_origin_data();

		if ( ! isset( $service_origins->limit->$type ) ) {
			return false;
		}

		return (int) $service_origins->limit->$type;
	}