PluginProbe
AI / trunk
AI vtrunk
1.3.0 1.2.0 1.1.0 1.0.2 1.0.1 1.0.0 0.9.0 trunk 0.1.1 0.2.0 0.2.1 0.3.0 0.3.1 0.4.0 0.4.1 0.5.0 0.6.0 0.7.0 0.8.0
ai / includes / Abstracts / Abstract_Gated_Ability.php

Abstract_Gated_Ability.php in AI trunk, at includes/Abstracts/Abstract_Gated_Ability.php

45 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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