PluginProbe
CSS & JavaScript Toolbox / 9.3
CSS & JavaScript Toolbox v9.3
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / framework / events / observers / wordpress-hook.observer.php

wordpress-hook.observer.php in CSS & JavaScript Toolbox 9.3, at framework/events/observers/wordpress-hook.observer.php

66 lines 1.2 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
7 //Import dependencies.
8 require_once 'observer.observer.php';
9
10 /**
11 *
12 */
13 abstract class CJTWordpressHookObserver extends CJTObserver {
14
15 /**
16 * put your comment there...
17 *
18 * @var mixed
19 */
20 protected $priority;
21
22 /**
23 *
24 */
25 const PRIORITY = 10;
26
27 /**
28 * put your comment there...
29 *
30 * @param mixed $priority
31 * @return CJTWordpressHookObserver
32 */
33 public function __construct($name = null, $filter = null, $priority = self::PRIORITY) {
34 // Initialize parent!
35 parent::__construct($name, $filter);
36 // Initialize vars!
37 $this->priority = $priority;
38 }
39
40 /**
41 * put your comment there...
42 *
43 * @param mixed $subject
44 * @param mixed $callback
45 * @return CJTObserver
46 */
47 protected function init($subject, $callback, $param) {
48 // Initialize parent!
49 $return = parent::init($subject, $callback, $param);
50 // Cache callback key!
51 $this->key = self::getObserverKey($this->subject->getHookName(), $this->callback, $this->priority);
52 return $return;
53 }
54
55 /**
56 * put your comment there...
57 *
58 * @param mixed $name
59 * @param mixed $callback
60 * @param mixed $priority
61 */
62 public static function getObserverKey($name, $callback, $priority = self::PRIORITY) {
63 return _wp_filter_build_unique_id($name, $callback, $priority);
64 }
65
66 } // End class