| 1 |
<?php |
| 2 |
/** |
| 3 |
* Abstract Gated Ability base class. |
| 4 |
* |
| 5 |
* @package WordPress\AI\Abstracts |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace WordPress\AI\Abstracts; |
| 11 |
|
| 12 |
/** |
| 13 |
* Base class for abilities that are gated behind an experiment. |
| 14 |
* |
| 15 |
* Each gated ability wraps the registration of one or more WordPress Abilities |
| 16 |
* so an experiment can register them together, only when the experiment is |
| 17 |
* enabled. |
| 18 |
* |
| 19 |
* @since 1.3.0 |
| 20 |
*/ |
| 21 |
abstract class Abstract_Gated_Ability { |
| 22 |
/** |
| 23 |
* Registers the underlying WordPress Ability (or abilities). |
| 24 |
* |
| 25 |
* Called only when the gating experiment is enabled. |
| 26 |
* |
| 27 |
* @since 1.3.0 |
| 28 |
*/ |
| 29 |
abstract public function register(): void; |
| 30 |
|
| 31 |
/** |
| 32 |
* Whether the ability needs core objects exposed to the Abilities API (via |
| 33 |
* Show_In_Abilities) before it registers. |
| 34 |
* |
| 35 |
* Defaults to false; override in abilities that depend on core-object exposure. |
| 36 |
* |
| 37 |
* @since 1.3.0 |
| 38 |
* |
| 39 |
* @return bool True if the ability depends on core-object exposure. |
| 40 |
*/ |
| 41 |
public function requires_core_object_exposure(): bool { |
| 42 |
return false; |
| 43 |
} |
| 44 |
} |
| 45 |
|