PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 1.2.1
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v1.2.1
10.56 1.2.1 10 10.1 10.2 10.3 10.31 10.32 10.33 10.34 10.50 10.51 10.52 10.53 10.55 9.0 9.0.1 9.4 trunk 1.0.0 1.1 1.2
easy-code-manager / framework / events / subjects / hook.subject.php

hook.subject.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 1.2.1, at framework/events/subjects/hook.subject.php

98 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 // Import dependencies.
10 require_once 'subject.subject.php';
11
12 /**
13 *
14 */
15 abstract class CJTEEWordpressHook extends CJTEESubject {
16
17 /**
18 * put your comment there...
19 *
20 * @var mixed
21 */
22 protected $hookName;
23
24 /**
25 * put your comment there...
26 *
27 * @var mixed
28 */
29 protected $instanceId;
30
31 /**
32 * put your comment there...
33 *
34 * @var mixed
35 */
36 protected static $instances = 0;
37
38 /**
39 * put your comment there...
40 *
41 */
42 public function __construct() {
43 $this->instanceId = ++self::$instances;
44 }
45
46 /**
47 * put your comment there...
48 *
49 * @param mixed $params
50 * @return mixed
51 */
52 public abstract function callIndirect($params);
53
54 /**
55 * put your comment there...
56 *
57 */
58 public function getHookName() {
59 return $this->hookName;
60 }
61
62 /**
63 * put your comment there...
64 *
65 */
66 public function getInstanceHookName() {
67 return "{$this->hookName}-{$this->instanceId}";
68 }
69
70 /**
71 * put your comment there...
72 *
73 * @param mixed $defintion
74 * @param mixed $includes
75 */
76 protected function init($name, $target, $defintion, $includes) {
77 // Initialize parent!
78 $return = parent::init($name, $target, $defintion, $includes);
79 $this->hookName = strtolower("{$this->definition['targetClass']}_{$name}");
80 // Register Wordpress Filter,
81 add_action($this->getHookName(), array(&$this, 'trigger'), 10, $this->getDefinitionCount('parameters'));
82 add_action($this->getInstanceHookName(), array(&$this, 'trigger'), 10, $this->getDefinitionCount('parameters'));
83 return $return;
84 }
85
86 /**
87 * put your comment there...
88 *
89 * @param mixed $params
90 */
91 public function prepareHookParameters($params) {
92 // Add tag as the first parameter!
93 array_unshift($params, $this->getInstanceHookName());
94 // Return!
95 return $params;
96 }
97
98 } // End class.