-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShortcode.php
More file actions
executable file
·46 lines (38 loc) · 938 Bytes
/
Shortcode.php
File metadata and controls
executable file
·46 lines (38 loc) · 938 Bytes
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
37
38
39
40
41
42
43
44
45
46
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Shortcode
*
* @author Martin
*/
class Shortcode {
private static $shortcodes = array();
public $tag = "";
public $module = "";
public $descr = "";
public $enabled = TRUE;
public $function;
public static function add_shortcode($tag, $func) {
if (is_callable($func)) {
$tmp = new Shortcode();
$tmp->tag = $tag;
$tmp->function = $func;
self::$shortcodes[$tag] = $tmp;
return TRUE;
}
return FALSE;
}
public static function remove_shortcode($tag) {
unset(self::$shortcodes[$tag]);
}
public static function remove_all_shortcodes() {
self::$shortcodes = array();
}
public static function getShortcodes(){
return self::$shortcodes;
}
}
?>