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
Colors.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Service; |
| 6 | |
| 7 | use AC\Admin\Colors\Shipped\ColorUpdater; |
| 8 | use AC\Admin\Colors\StyleInjector; |
| 9 | use AC\Registerable; |
| 10 | |
| 11 | final class Colors implements Registerable |
| 12 | { |
| 13 | private ColorUpdater $shipped_colors_updater; |
| 14 | |
| 15 | private StyleInjector $style_injector; |
| 16 | |
| 17 | public function __construct(ColorUpdater $shipped_colors_updater, StyleInjector $style_injector) |
| 18 | { |
| 19 | $this->shipped_colors_updater = $shipped_colors_updater; |
| 20 | $this->style_injector = $style_injector; |
| 21 | } |
| 22 | |
| 23 | public function register(): void |
| 24 | { |
| 25 | add_action('admin_init', function () { |
| 26 | $this->shipped_colors_updater->update(); |
| 27 | }); |
| 28 | add_action('admin_head', function () { |
| 29 | $this->style_injector->inject_style(); |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | } |
| 34 |