Skip to content

Commit

Permalink
🧑‍💻 Reverse the template hierarchy when the theme supports `block-tem…
Browse files Browse the repository at this point in the history
…plates` (#364)
  • Loading branch information
Log1x authored Mar 28, 2024
1 parent c3fe2c8 commit aac03d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Roots/Acorn/Sage/Concerns/FiltersTemplates.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ trait FiltersTemplates
*/
public function filterTemplateHierarchy($files)
{
return [...$this->sageFinder->locate($files), ...$files];
$templates = [...$this->sageFinder->locate($files), ...$files];

return ! get_theme_support('block-templates')
? $templates
: array_reverse($templates);
}

/**
Expand Down

0 comments on commit aac03d6

Please sign in to comment.