PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 10
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v10
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 / wordpress.class.php

wordpress.class.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 10, at framework/events/wordpress.class.php

84 lines 1.9 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 *
8 */
9 class CJTWordpressEvents extends CJTEvents {
10
11 /**
12 *
13 */
14 const HOOK_ACTION = 'action';
15
16 /**
17 *
18 */
19 const HOOK_CUSTOM = 'custom';
20
21 /**
22 *
23 */
24 const HOOK_FILTER = 'filter';
25
26 /**
27 * put your comment there...
28 *
29 * @param mixed $options
30 */
31 public static function __init($options = array()) {
32 // Initialize CJTEvents!
33 parent::__init($options);
34 // Extend all Hookable objects with CJTEvents events!
35 $events = new CJTWordpressEvents(__CLASS__, $options, true);
36 // Inherits all CJTEvents and CJTWordpressEvents Events to all hookable objects!
37 self::$definition->addBaseClass(__CLASS__, array('hookType' => self::HOOK_FILTER));
38 return $events;
39 }
40
41 /**
42 * put your comment there...
43 *
44 * @param mixed $type
45 */
46 protected function prepareEventTypeOptions($event) {
47 $type =& $event['type'];
48 switch ($type['hookType']) {
49 case self::HOOK_ACTION:
50 $type['subjectClass'] = 'CJTEEWordpressHookAction';
51 $type['file'] = 'action.subject.php';
52 $type['observerClass'] = 'CJTWordpressActionHookObserver';
53 $type['observerFile'] = 'wordpress-hook-action.observer.php';
54 break;
55 case self::HOOK_FILTER:
56 $type['subjectClass'] = 'CJTEEWordpressHookFilter';
57 $type['file'] = 'filter.subject.php';
58 $type['observerClass'] = 'CJTWordpressFilterHookObserver';
59 $type['observerFile'] = 'wordpress-hook-filter.observer.php';
60 break;
61 }
62 return $event;
63 }
64
65 /**
66 * put your comment there...
67 *
68 * @param mixed $type
69 * @param mixed $params
70 */
71 public function trigger($typeName, $params = array(), $typePrefixed = true) {
72 $result = false;
73 // Get type object!
74 $type = $this->parseEventType($typeName, $typePrefixed);
75 // Get event type subject!
76 $subject = $this->getSubject($type);
77 // Notify observers!
78 if ($subject) {
79 $result = call_user_func(array(&$subject, 'callIndirect'), $params);
80 }
81 return $result;
82 }
83
84 } // End class.