Hooks::filter_template_path_list( array $folders, Tribe__Template $template )

Filters the list of folders that will be looked over to find templates and add the Event Tickets Plus.


Parameters #

$folders

(array) (Required) The current list of folders that will be searched template files.

$template

(Tribe__Template) (Required) Which template instance we are dealing with.


Top ↑

Return #

(array) The filtered list of folders that will be searched for the templates.


Top ↑

Source #

File: src/Tickets_Plus/Hooks.php

	public function filter_template_path_list( array $folders, Tribe__Template $template ) {
		/** @var Plugin $main */
		$main = tribe( 'tickets-plus.main' );

		$path = (array) rtrim( $main->plugin_path, '/' );

		// Pick up if the folder needs to be added to the public template path.
		$folder = $template->get_template_folder();

		if ( ! empty( $folder ) ) {
			$path = array_merge( $path, $folder );
		}

		$folders['event-tickets-plus'] = [
			'id'        => 'event-tickets-plus',
			'namespace' => $main->template_namespace,
			'priority'  => 16,
			'path'      => implode( DIRECTORY_SEPARATOR, $path ),
		];

		return $folders;
	}

Top ↑

Changelog #

Changelog
Version Description
5.3.0 Introduced.