| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Give\VendorOverrides\Harbor\Actions; |
| 6 |
|
| 7 |
/** |
| 8 |
* Whether Harbor has fully loaded, which only happens when a premium plugin |
| 9 |
* is installed and active. |
| 10 |
* |
| 11 |
* Harbor is vendor-prefixed per host plugin, so only one Harbor copy runs as |
| 12 |
* the version leader so we cannot use the classes to determine if Harbor is loaded. |
| 13 |
*/ |
| 14 |
class HarborHasLoaded |
| 15 |
{ |
| 16 |
/** |
| 17 |
* @since 4.16.7 |
| 18 |
* |
| 19 |
* Safe to call on or after `plugins_loaded`. Harbor fires `lw_harbor/loaded` |
| 20 |
* during its init (Give boots Harbor from `plugins_loaded`), and only when |
| 21 |
* at least one premium plugin reports itself via `lw_harbor/premium_plugin_exists`. |
| 22 |
* |
| 23 |
* @return bool Whether Harbor has fully loaded. |
| 24 |
*/ |
| 25 |
public function __invoke(): bool |
| 26 |
{ |
| 27 |
return (bool) did_action('lw_harbor/loaded'); |
| 28 |
} |
| 29 |
} |
| 30 |
|