PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.7.0
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.7.0
1.7.2 1.7.1 1.7.0 1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / vendor / automattic / jetpack-autoloader / src / class-hook-manager.php
hostinger-reach / vendor / automattic / jetpack-autoloader / src Last commit date
AutoloadFileWriter.php 7 months ago AutoloadGenerator.php 1 month ago AutoloadProcessor.php 1 year ago CustomAutoloaderPlugin.php 1 month ago ManifestGenerator.php 1 year ago autoload.php 1 year ago class-autoloader-handler.php 1 year ago class-autoloader-locator.php 1 year ago class-autoloader.php 1 year ago class-container.php 1 year ago class-hook-manager.php 1 year ago class-latest-autoloader-guard.php 1 year ago class-manifest-reader.php 1 year ago class-path-processor.php 1 year ago class-php-autoloader.php 1 year ago class-plugin-locator.php 1 year ago class-plugins-handler.php 1 year ago class-shutdown-handler.php 1 year ago class-version-loader.php 1 year ago class-version-selector.php 1 year ago
class-hook-manager.php
69 lines
1 <?php
2 /* HEADER */ // phpcs:ignore
3
4 /**
5 * Allows the latest autoloader to register hooks that can be removed when the autoloader is reset.
6 */
7 class Hook_Manager {
8
9 /**
10 * An array containing all of the hooks that we've registered.
11 *
12 * @var array
13 */
14 private $registered_hooks;
15
16 /**
17 * The constructor.
18 */
19 public function __construct() {
20 $this->registered_hooks = array();
21 }
22
23 /**
24 * Adds an action to WordPress and registers it internally.
25 *
26 * @param string $tag The name of the action which is hooked.
27 * @param callable $callable The function to call.
28 * @param int $priority Used to specify the priority of the action.
29 * @param int $accepted_args Used to specify the number of arguments the callable accepts.
30 */
31 public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
32 $this->registered_hooks[ $tag ][] = array(
33 'priority' => $priority,
34 'callable' => $callable,
35 );
36
37 add_action( $tag, $callable, $priority, $accepted_args );
38 }
39
40 /**
41 * Adds a filter to WordPress and registers it internally.
42 *
43 * @param string $tag The name of the filter which is hooked.
44 * @param callable $callable The function to call.
45 * @param int $priority Used to specify the priority of the filter.
46 * @param int $accepted_args Used to specify the number of arguments the callable accepts.
47 */
48 public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
49 $this->registered_hooks[ $tag ][] = array(
50 'priority' => $priority,
51 'callable' => $callable,
52 );
53
54 add_filter( $tag, $callable, $priority, $accepted_args );
55 }
56
57 /**
58 * Removes all of the registered hooks.
59 */
60 public function reset() {
61 foreach ( $this->registered_hooks as $tag => $hooks ) {
62 foreach ( $hooks as $hook ) {
63 remove_filter( $tag, $hook['callable'], $hook['priority'] );
64 }
65 }
66 $this->registered_hooks = array();
67 }
68 }
69