PluginProbe
Hostinger Tools / 2.1.1
Hostinger Tools v2.1.1
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
← All changes | includes/class-hostinger-loader.php +17 -9 1.8.22.1.1 View file →
@@ -6,10 +6,10 @@
6 6 protected array $actions;
7 7 protected array $filters;
8 8
9 9 public function __construct() {
10 - $this->actions = [];
11 - $this->filters = [];
10 + $this->actions = array();
11 + $this->filters = array();
12 12 }
13 13
14 14 public function add_action( string $hook, $component, string $callback, int $priority = 10, int $accepted_args = 1 ) {
15 15 $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
@@ -27,15 +27,15 @@
27 27 string $callback,
28 28 int $priority,
29 29 int $accepted_args
30 30 ): array {
31 - $hooks[] = [
31 + $hooks[] = array(
32 32 'hook' => $hook,
33 33 'component' => $component,
34 34 'callback' => $callback,
35 35 'priority' => $priority,
36 - 'accepted_args' => $accepted_args
37 - ];
36 + 'accepted_args' => $accepted_args,
37 + );
38 38
39 39 return $hooks;
40 40 }
41 41
@@ -43,14 +43,22 @@
43 43 * @return void
44 44 */
45 45 public function run(): void {
46 46 foreach ( $this->filters as $hook ) {
47 - add_filter( $hook['hook'], [ $hook['component'], $hook['callback'] ], $hook['priority'],
48 - $hook['accepted_args'] );
47 + add_filter(
48 + $hook['hook'],
49 + array( $hook['component'], $hook['callback'] ),
50 + $hook['priority'],
51 + $hook['accepted_args']
52 + );
49 53 }
50 54
51 55 foreach ( $this->actions as $hook ) {
52 - add_action( $hook['hook'], [ $hook['component'], $hook['callback'] ], $hook['priority'],
53 - $hook['accepted_args'] );
56 + add_action(
57 + $hook['hook'],
58 + array( $hook['component'], $hook['callback'] ),
59 + $hook['priority'],
60 + $hook['accepted_args']
61 + );
54 62 }
55 63 }
56 64 }