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

Filters the list of folders TEC will look up to find templates to add the ones defined by Filter Bar.


Parameters #

$folders

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

Default value: array()

$template

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


Top ↑

Return #

(TribeEventsFilterbarViewsV2array<string,array>) The filtered list of folders that will be searched for the templates.


Top ↑

Source #

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

	public function filter_template_path_list( array $folders = [], \Tribe__Template $template ) {
		$main = Main::instance();

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

		// 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['events-filterbar'] = [
			'id'        => 'events-filterbar',
			'namespace' => $main->template_namespace,
			'priority'  => 25,
			'path'      => implode( DIRECTORY_SEPARATOR, $path ),
		];

		return $folders;
	}

Top ↑

Changelog #

Changelog
Version Description
TBD Introduced.