AdminBar.php
2 days ago
AdminBarEditColumns.php
2 days ago
Colors.php
2 days ago
CommonAssets.php
2 days ago
CurrentTable.php
2 days ago
ManageHeadings.php
2 days ago
ManageValue.php
2 days ago
NoticeChecks.php
2 days ago
PluginUpdate.php
2 days ago
PromoChecks.php
2 days ago
QuickEdit.php
2 days ago
SaveHeadings.php
2 days ago
Setup.php
2 days ago
TableRows.php
2 days ago
Tooltips.php
2 days ago
View.php
2 days ago
View.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Service; |
| 6 | |
| 7 | use AC\Asset\Location; |
| 8 | use AC\Registerable; |
| 9 | |
| 10 | class View implements Registerable |
| 11 | { |
| 12 | private Location $location; |
| 13 | |
| 14 | public function __construct(Location $location) |
| 15 | { |
| 16 | $this->location = $location; |
| 17 | } |
| 18 | |
| 19 | public function register(): void |
| 20 | { |
| 21 | add_filter('ac/view/templates', [$this, 'templates']); |
| 22 | } |
| 23 | |
| 24 | public function templates(array $templates): array |
| 25 | { |
| 26 | $templates[] = $this->location->with_suffix('templates')->get_path(); |
| 27 | |
| 28 | return $templates; |
| 29 | } |
| 30 | |
| 31 | } |
| 32 |