Template_Override::set_product_archive_template_path( string[] $templates )

Summary

No summary available.

Parameters

$templates

(string[]) (Required)


Return

(string[])


Source

File: src/BigCommerce/Templates/Template_Override.php

	public function set_product_archive_template_path( $templates ) {
		if ( ! is_post_type_archive( Product::NAME ) ) {
			return $templates;
		}

		// strip out archive.php to force post-type-specific template
		$templates = array_filter( $templates, function ( $path ) {
			return ! in_array( $path, [ 'archive.php', 'index.php' ] );
		} );

		$prefixed = $this->prefix_theme_paths( $templates );

		return array_merge( $prefixed, $templates );
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.