Template_Override::set_taxonomy_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_taxonomy_archive_template_path( $templates ) { if ( ! is_tax( [ Product_Category::NAME, Brand::NAME ] ) ) { return $templates; } // strip out generic templates to force post-type-specific template $templates = array_filter( $templates, function ( $path ) { return ! in_array( $path, [ 'taxonomy.php', 'archive.php', 'index.php' ] ); } ); $templates[] = sprintf( 'archive-%s.php', Product::NAME ); $prefixed = $this->prefix_theme_paths( $templates ); return array_merge( $prefixed, $templates ); }