public function taxonomy( $template ) {

		$templates = [];

		// Get the queried term object.
		$term = get_queried_object();
		$slug = urldecode( $term->slug );

		// Remove 'post-format' from the slug.
		if ( 'post_format' === $term->taxonomy ) {
			$slug = str_replace( 'post-format-', '', $slug );
		}

		// Slug-based template.
		$templates[] = "taxonomy-{$term->taxonomy}-{$slug}.php";

		// Taxonomy-specific template.
		$templates[] = "taxonomy-{$term->taxonomy}.php";

		// Default template.
		$templates[] = 'taxonomy.php';

		// Return the template hierarchy.
		return $templates;
	}
public function taxonomy( $template ) {

		$templates = [];

		// Get the queried term object.
		$term = get_queried_object();
		$slug = urldecode( $term->slug );

		// Remove 'post-format' from the slug.
		if ( 'post_format' === $term->taxonomy ) {
			$slug = str_replace( 'post-format-', '', $slug );
		}

		// Slug-based template.
		$templates[] = "taxonomy-{$term->taxonomy}-{$slug}.php";

		// Taxonomy-specific template.
		$templates[] = "taxonomy-{$term->taxonomy}.php";

		// Default template.
		$templates[] = 'taxonomy.php';

		// Return the template hierarchy.
		return $templates;
	}
public function taxonomy ( $ template ) { $ templates = [ ] ; // Get the queried term object. $ term = get_queried_object ( ) ; $ slug = urldecode ( $ term -> slug ) ; // Remove 'post-format' from the slug. if ( 'post_format' === $ term -> taxonomy ) { $ slug = str_replace ( 'post-format-' , '' , $ slug ) ; } // Slug-based template. $ templates [ ] = "taxonomy-{$term->taxonomy}-{$slug}.php" ; // Taxonomy-specific template. $ templates [ ] = "taxonomy-{$term->taxonomy}.php" ; // Default template. $ templates [ ] = 'taxonomy.php' ; // Return the template hierarchy. return $ templates ; }
Overrides WP's default template for taxonomy-based archives. This
allows better organization of taxonomy template files by making
categories and post tags work the same way as other taxonomies.

@since  5.0.0
@access public
@param  array   $templates
@return array
Overrides WP s default template for taxonomy - based archives . This allows better organization of taxonomy template files by making categories and post tags work the same way as other taxonomies .