-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunctions.php
100 lines (92 loc) · 2.43 KB
/
functions.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
use \WPControllers\Post;
use \WPControllers\Page;
use \WPControllers\Term;
use \WPControllers\User;
if ( !function_exists('get_post_controller') ) {
/**
* Global function to call PostController::get_controller
* @see PostController::get_controller
*
* @param string|null $key
* @param array $options
*
* @return Post
*/
function get_post_controller($key = null, $options = array()) { return Post::get_controller($key, $options); }
}
if ( !function_exists('get_post_controllers') ) {
/**
* Global function to call PostController::get_controllers
* @see PostController::get_controllers
*
* @param array $args
*
* @return Post[]
*/
function get_post_controllers($args = null) { return Post::get_controllers($args); }
}
if ( !function_exists('get_page_controllers') ) {
/**
* Global function to call Page::get_controllers
* @see PostController::get_controllers
*
* @param array $args
*
* @return array
*/
function get_page_controllers($args = null) { return Page::get_controllers($args); }
}
if ( !function_exists('get_term_controller') ) {
/**
* Global function to call Term::get_controller
* @see Term::get_controller
*
* @param string $key
* @param string $taxonomy
* @param string $field
* @param array $options
*
* @return Term
*/
function get_term_controller($key = null, $taxonomy = null, $field = 'id', $options = array()) {
return Term::get_controller($key, $taxonomy, $field, $options);
}
}
if ( !function_exists('get_term_controllers') ) {
/**
* Global function to call Term::get_controllers
* @see Term::get_controller
*
* @param $args array
*
* @return array
*/
function get_term_controllers($args) {
return Term::get_controllers($args);
}
}
if ( !function_exists('get_user_controller') ) {
/**
* Global function to call User::get_controller
* @see User::get_controller
*
* @param string|null $key
* @param string $field
* @param array $options
*
* @return User
*/
function get_user_controller($key = null, $field = 'id', $options = array()) { return User::get_controller($key, $field, $options); }
}
if ( !function_exists('get_user_controllers') ) {
/**
* Global function to calll User::get_controllers
* @see User::get_controllers
*
* @param array $args
*
* @return array
*/
function get_user_controllers($args) { return User::get_controllers($args); }
}