Repository

Class Repository


Source

File: src/Tribe/Views/V2/Repository.php

class Repository {

	/**
	 * Filters a View repository args to add the virtual ones.
	 *
	 * @since 1.0.1
	 *
	 * @param array        $repository_args The current repository args.
	 * @param Context|null $context         An instance of the context the View is using or `null` to use the
	 *                                      global Context.
	 *
	 * @return array The filtered repository args.
	 */
	public function filter_repository_args( array $repository_args, Context $context = null ) {
		$context = null !== $context ? $context : tribe_context();

		if ( $context->is( 'virtual' ) ) {
			$repository_args['virtual'] = true;
		}

		return $repository_args;
	}
}

Top ↑

Changelog

Changelog
Version Description
1.0.1 Introduced.

Top ↑

Methods