# site-reviews/trunk/plugin/Controllers/DashboardController.php

Site Reviews, version trunk. 35 lines.

- Page: https://pluginprobe.com/plugins/site-reviews/trunk/code/plugin/Controllers/DashboardController.php
- Raw: https://pluginprobe.com/plugins/site-reviews/trunk/raw/plugin/Controllers/DashboardController.php
- Modified: 2024-07-17T10:26:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/site-reviews/trunk/code/plugin/Controllers/DashboardController.php#L10-L20`.

```php
<?php

namespace GeminiLabs\SiteReviews\Controllers;

use GeminiLabs\SiteReviews\Database\Cache;
use GeminiLabs\SiteReviews\Metaboxes\DashboardMetabox;

class DashboardController extends AbstractController
{
    /**
     * @action transition_post_status:5
     */
    public function flushMonthlyCountCache(string $newStatus, string $oldStatus, ?\WP_Post $post): void
    {
        if (is_null($post)) {
            return; // This should never happen, but some plugins are bad actors so...
        }
        if (glsr()->post_type !== $post->post_type) {
            return;
        }
        if ($newStatus === $oldStatus) {
            return;
        }
        glsr(Cache::class)->delete('monthly', 'count');
    }

    /**
     * @action wp_dashboard_setup
     */
    public function registerMetaBoxes(): void
    {
        glsr(DashboardMetabox::class)->register();
    }
}

```
