forked from gmazzap/Striatum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hooks.php
36 lines (33 loc) · 1.22 KB
/
Hooks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php namespace Brain;
/**
* Hooks Class
*
* ##############################################################################################
* Striatum package allows an object-oriented way to handle WordPress hooks.
* ##############################################################################################
*
* It uses an implementation of Observer pattern, where every hook is associated to a Subject
* instance, that notify all the Observer instances attached: so where WP core plugin API uses
* callbacks and global variables, this package uses objects.
*
* This class is a sort of *proxy* to ease the package API calls.
* All the API functions are defined in the class Brain\Striatum\API and can be called using this
* class static methods, like:
*
* Brain\Hooks::addAction( $id, $hook, $callback, $priority );
*
* Same methods can be also called using dynamic methods:
*
* $api = new Brain\Hooks();
* $api->addAction( $id, $hook, $callback, $priority );
*
* This is useful when the package is used inside OOP plugins, making use of dependency injection.
*
* @package Brain\Striatum
* @version 0.1.5
*/
class Hooks extends Facade {
static function getBindId() {
return 'hooks.api';
}
}