WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

WC_Template_Loader::get_template_loader_files() private WC 3.0.0

Get an array of filenames to search for a given template.

{} Это метод класса: WC_Template_Loader{}

Хуки из метода
Возвращает

Строку[].

Использование

$result = WC_Template_Loader::get_template_loader_files( $default_file );
$default_file(строка) (обязательный)
The default file name.

Список изменений

С версии 3.0.0 Введена.

Код WC_Template_Loader::get_template_loader_files() WC 5.0.0

<?php
private static function get_template_loader_files( $default_file ) {
	$templates   = apply_filters( 'woocommerce_template_loader_files', array(), $default_file );
	$templates[] = 'woocommerce.php';

	if ( is_page_template() ) {
		$page_template = get_page_template_slug();

		if ( $page_template ) {
			$validated_file = validate_file( $page_template );
			if ( 0 === $validated_file ) {
				$templates[] = $page_template;
			} else {
				error_log( "WooCommerce: Unable to validate template path: \"$page_template\". Error Code: $validated_file." );
			}
		}
	}

	if ( is_singular( 'product' ) ) {
		$object       = get_queried_object();
		$name_decoded = urldecode( $object->post_name );
		if ( $name_decoded !== $object->post_name ) {
			$templates[] = "single-product-{$name_decoded}.php";
		}
		$templates[] = "single-product-{$object->post_name}.php";
	}

	if ( is_product_taxonomy() ) {
		$object = get_queried_object();

		$templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
		$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
		$templates[] = 'taxonomy-' . $object->taxonomy . '.php';
		$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '.php';

		if ( is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
			$cs_taxonomy = str_replace( '_', '-', $object->taxonomy );
			$cs_default  = str_replace( '_', '-', $default_file );
			$templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
			$templates[] = WC()->template_path() . 'taxonomy-' . $cs_taxonomy . '-' . $object->slug . '.php';
			$templates[] = 'taxonomy-' . $object->taxonomy . '.php';
			$templates[] = WC()->template_path() . 'taxonomy-' . $cs_taxonomy . '.php';
			$templates[] = $cs_default;
		}
	}

	$templates[] = $default_file;
	if ( isset( $cs_default ) ) {
		$templates[] = WC()->template_path() . $cs_default;
	}
	$templates[] = WC()->template_path() . $default_file;

	return array_unique( $templates );
}