PluginProbe ʕ •ᴥ•ʔ
Akismet Anti-spam: Spam Protection / 5.7
Akismet Anti-spam: Spam Protection v5.7
5.7 3.0.4 3.0.5 3.1 3.1.1 3.1.10 3.1.11 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 5.0 5.0.1 5.0.2 5.1 5.2 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.4 5.5 5.6 trunk 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.4.0 2.4.1 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 3.0.0 3.0.0-RC1 3.0.1 3.0.2 3.0.3
akismet / abilities / interface-akismet-ability.php
akismet / abilities Last commit date
class-akismet-ability-comment-check.php 1 month ago class-akismet-ability-get-stats.php 1 month ago class-akismet-ability.php 1 month ago interface-akismet-ability.php 2 months ago
interface-akismet-ability.php
63 lines
1 <?php
2 /**
3 * Interface for Akismet abilities.
4 *
5 * @package Akismet
6 * @since 5.7
7 */
8
9 declare( strict_types = 1 );
10
11 /**
12 * Interface Akismet_Ability_Interface
13 */
14 interface Akismet_Ability_Interface {
15
16 /**
17 * Get the ability configuration array.
18 *
19 * Returns the configuration array used to register the ability with wp_register_ability().
20 *
21 * @return array {
22 * The ability configuration array.
23 *
24 * @type string $label A human-readable name for the ability. Used for display purposes. Should be translatable.
25 * @type string $description A detailed description of what the ability does, its purpose, and its parameters or return values.
26 * This is crucial for AI agents to understand how and when to use the ability.
27 * @type string $category The slug of the category this ability belongs to. The category must be registered before
28 * registering the ability.
29 * @type array $output_schema A JSON Schema definition describing the expected format of the data returned by the ability.
30 * Used for validation and documentation.
31 * @type callable $execute_callback The PHP function or method to execute when this ability is called. Receives optional input
32 * argument matching the input schema type.
33 * @type callable $permission_callback A callback function to check if the current user has permission to execute this ability.
34 * Returns boolean or WP_Error.
35 * @type array $input_schema Optional. JSON Schema defining expected input parameters. Required when the ability accepts inputs.
36 * @type array $meta Optional. An associative array for storing arbitrary additional metadata about the ability,
37 * including 'annotations' (readonly, destructive, idempotent flags) and 'show_in_rest'.
38 * @type string $ability_class Optional. Custom class name extending WP_Ability for behavior customization.
39 * }
40 */
41 public function get_config(): array;
42
43 /**
44 * Execute callback for the ability.
45 *
46 * Runs the main functionality of the ability.
47 *
48 * @param array|null $input The input parameters for the ability. Null when no input provided.
49 * @return array|WP_Error The result of the execution or a WP_Error on failure.
50 */
51 public function execute( ?array $input = null );
52
53 /**
54 * Permission callback for the ability.
55 *
56 * Checks if the current user has permission to execute the ability.
57 *
58 * @param array|null $input The input parameters for the ability. Null when no input provided.
59 * @return bool Whether the current user has permission.
60 */
61 public function current_user_has_permission( ?array $input = null ): bool;
62 }
63