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`
  • Loading branch information
Log1x committed Mar 28, 2024
1 parent 0e64acb commit 44c8a1e
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 44c8a1e

Please sign in to comment.