PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.0.13
Kirki – Freeform Page Builder, Website Builder & Customizer v6.0.13
6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / libraries / framework / Wordpress / Contracts / HookSubscriber.php
kirki / libraries / framework / Wordpress / Contracts Last commit date
HookSubscriber.php 3 weeks ago
HookSubscriber.php
61 lines
1 <?php
2
3 /**
4 * Interface HookSubscriber Defines the contract for a
5 * class that can subscribe to a WordPress hook (action or filter) and handle it with optional configuration.
6 * Implementing classes should define which hook they subscribe to,
7 * the type of the hook (action or filter), and optionally the priority and argument count.
8 *
9 * @package Framework
10 * @subpackage Wordpress\Contracts
11 * @since 1.0.0
12 */
13 namespace Kirki\Framework\Wordpress\Contracts;
14
15 \defined('ABSPATH') || exit;
16 interface HookSubscriber
17 {
18 /**
19 * Get the name of the WordPress hook this subscriber listens to.
20 *
21 * @return string The hook name (e.g., 'init', 'rest_api_init', etc.)
22 *
23 * @since 1.0.0
24 */
25 public function get_name();
26 /**
27 * Get the type of the hook: 'action' or 'filter'.
28 *
29 * @return string Either 'action' or 'filter'.
30 *
31 * @since 1.0.0
32 */
33 public function get_type();
34 /**
35 * Get the priority at which the hook should be fired.
36 *
37 * @return int The priority level (default is 10).
38 *
39 * @since 1.0.0
40 */
41 public function get_priority();
42 /**
43 * Get the number of arguments the hook callback accepts.
44 *
45 * @return int Number of accepted arguments.
46 *
47 * @since 1.0.0
48 */
49 public function get_args_count();
50 /**
51 * Handle the hook logic. Will be called when the hook is fired.
52 *
53 * @param mixed $args The positional arguments.
54 *
55 * @return mixed Return value is only used for filters. Actions can return void.
56 *
57 * @since 1.0.0
58 */
59 public function handle(...$args);
60 }
61