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 / BaseHook.php
kirki / libraries / framework / Wordpress Last commit date
Constants 2 weeks ago Contracts 2 weeks ago Hooks 2 weeks ago Models 2 weeks ago BaseHook.php 2 weeks ago HookServiceProvider.php 2 weeks ago Menu.php 2 weeks ago User.php 2 weeks ago UserMeta.php 2 weeks ago
BaseHook.php
70 lines
1 <?php
2
3 /**
4 * Base hook subscriber with sensible defaults for WordPress action and filter registration.
5 * Implements HookSubscriber with standard priority and accepted-args values for concrete hook classes.
6 * Reduces boilerplate when wiring framework integrations into WordPress lifecycle events.
7 * Subclasses must implement: - get_name() - get_type() - handle()
8 * This class also defines constants for hook types: ACTION and FILTER.
9 *
10 * @package Framework
11 * @subpackage Wordpress
12 * @since 1.0.0
13 */
14 namespace Kirki\Framework\Wordpress;
15
16 \defined('ABSPATH') || exit;
17 use Kirki\Framework\Wordpress\Contracts\HookSubscriber;
18 abstract class BaseHook implements HookSubscriber
19 {
20 /**
21 * Get the priority for this hook. Can be overridden by subclasses.
22 *
23 * @return int Hook priority. Lower numbers correspond to earlier execution.
24 *
25 * @since 1.0.0
26 */
27 public function get_priority()
28 {
29 return 10;
30 }
31 /**
32 * Get the number of arguments accepted by the hook callback.
33 * Can be overridden by subclasses.
34 *
35 * @return int Number of accepted arguments.
36 *
37 * @since 1.0.0
38 */
39 public function get_args_count()
40 {
41 return 1;
42 }
43 /**
44 * Get the name.
45 *
46 * @return mixed
47 *
48 * @since 1.0.0
49 */
50 public abstract function get_name();
51 /**
52 * Get the type.
53 *
54 * @return mixed
55 *
56 * @since 1.0.0
57 */
58 public abstract function get_type();
59 /**
60 * Handle.
61 *
62 * @param mixed $args The positional arguments.
63 *
64 * @return void
65 *
66 * @since 1.0.0
67 */
68 public abstract function handle(...$args);
69 }
70