BackupPluginsNotice.php
1 year ago
BooleanNotice.php
2 years ago
CliIntegrationNotice.php
1 day ago
DisabledItemsNotice.php
2 years ago
DismissNotice.php
1 day ago
NextGenEngineNotice.php
1 day ago
Notices.php
1 day ago
NoticesHandler.php
11 months ago
ObjectCacheNotice.php
11 months ago
OutdatedWpStagingNotice.php
1 year ago
WarningsNotice.php
2 years ago
WpVersionCompatNotice.php
3 months ago
DisabledItemsNotice.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPStaging\Framework\Notices; |
| 4 | |
| 5 | use WPStaging\Framework\SiteInfo; |
| 6 | |
| 7 | /** |
| 8 | * Class DisabledItemsNotice |
| 9 | * |
| 10 | * This class is used to show notice about what WP Staging has disabled on the staging site |
| 11 | * |
| 12 | * @see \WPStaging\Framework\Notices\Notices; |
| 13 | */ |
| 14 | class DisabledItemsNotice extends BooleanNotice |
| 15 | { |
| 16 | /** |
| 17 | * The option name to store the visibility of disabled cache notice |
| 18 | */ |
| 19 | const OPTION_NAME = 'wpstg_disabled_notice'; |
| 20 | |
| 21 | private $siteInfo; |
| 22 | |
| 23 | public function __construct(SiteInfo $siteInfo) |
| 24 | { |
| 25 | $this->siteInfo = $siteInfo; |
| 26 | } |
| 27 | |
| 28 | public function getOptionName(): string |
| 29 | { |
| 30 | return self::OPTION_NAME; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Show this notice only on staging site |
| 35 | * |
| 36 | * @return bool |
| 37 | */ |
| 38 | public function isEnabled(): bool |
| 39 | { |
| 40 | // Early bail if not staging site |
| 41 | if (!$this->siteInfo->isStagingSite()) { |
| 42 | return false; |
| 43 | } |
| 44 | |
| 45 | return parent::isEnabled(); |
| 46 | } |
| 47 | } |
| 48 |