DashboardWidgetServiceProvider.php
22 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPStaging\Backend\DashboardWidget; |
| 4 | |
| 5 | use WPStaging\Framework\DI\ServiceProvider; |
| 6 | |
| 7 | /** |
| 8 | * Registers the WP Staging admin dashboard widget on `wp_dashboard_setup`. |
| 9 | */ |
| 10 | class DashboardWidgetServiceProvider extends ServiceProvider |
| 11 | { |
| 12 | protected function registerClasses() |
| 13 | { |
| 14 | $this->container->singleton(DashboardWidget::class); |
| 15 | } |
| 16 | |
| 17 | protected function addHooks() |
| 18 | { |
| 19 | add_action('wp_dashboard_setup', $this->container->callback(DashboardWidget::class, 'register')); |
| 20 | } |
| 21 | } |
| 22 |