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 / observers / wordpress-hook.observer.php

wordpress-hook.observer.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 1.2.1, 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