1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the WPPhpSpecBridge library. |
5
|
|
|
* |
6
|
|
|
* Copyright (c) 2015-2016 LIN3S <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @author Beñat Espiña <[email protected]> |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace { |
15
|
|
|
define('WP_DEBUG', true); |
16
|
|
|
|
17
|
|
|
class WP_Widget |
18
|
|
|
{ |
19
|
|
|
public $id_base; |
20
|
|
|
public $name; |
21
|
|
|
public $number = false; |
22
|
|
|
|
23
|
|
|
public function __construct($id_base, $name, $widget_options = [], $control_options = []) |
|
|
|
|
24
|
|
|
{ |
25
|
|
|
$this->id_base = empty($id_base) ? preg_replace('/(wp_)?widget_/', '', strtolower(get_class($this))) : strtolower($id_base); |
26
|
|
|
$this->name = $name; |
27
|
|
|
$this->option_name = 'widget_' . $this->id_base; |
|
|
|
|
28
|
|
|
} |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
function add_action($hook, $callback) |
|
|
|
|
32
|
|
|
{ |
33
|
|
|
return true; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
function add_filter($tag, $functionToAdd) |
|
|
|
|
37
|
|
|
{ |
38
|
|
|
return true; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
function add_theme_support($feature) |
|
|
|
|
42
|
|
|
{ |
43
|
|
|
return true; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
function wp_enqueue_script($name, $from, $dependencies, $version, $inFooter) |
|
|
|
|
47
|
|
|
{ |
48
|
|
|
return true; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
function wp_enqueue_style($name, $from, $dependencies, $version, $media) |
|
|
|
|
52
|
|
|
{ |
53
|
|
|
return true; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
function get_template_directory_uri() |
57
|
|
|
{ |
58
|
|
|
return true; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
function is_admin() |
62
|
|
|
{ |
63
|
|
|
return true; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
function add_post_type_support() |
67
|
|
|
{ |
68
|
|
|
return true; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
function remove_post_type_support() |
72
|
|
|
{ |
73
|
|
|
return true; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
function register_widget($className) |
|
|
|
|
77
|
|
|
{ |
78
|
|
|
return true; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
function get_bloginfo() |
82
|
|
|
{ |
83
|
|
|
return 'WordPress Standard'; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
function home_url() |
87
|
|
|
{ |
88
|
|
|
return 'http://wordpress-standard'; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
function is_embed() |
92
|
|
|
{ |
93
|
|
|
return true; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
function is_404() |
97
|
|
|
{ |
98
|
|
|
return true; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
function is_search() |
102
|
|
|
{ |
103
|
|
|
return true; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
function is_front_page() |
107
|
|
|
{ |
108
|
|
|
return true; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
function is_home() |
112
|
|
|
{ |
113
|
|
|
return true; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
function is_post_type_archive() |
117
|
|
|
{ |
118
|
|
|
return true; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
function is_tax() |
122
|
|
|
{ |
123
|
|
|
return true; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
function is_attachment() |
127
|
|
|
{ |
128
|
|
|
return true; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
function is_single() |
132
|
|
|
{ |
133
|
|
|
return true; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
function is_page() |
137
|
|
|
{ |
138
|
|
|
return true; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
function is_singular() |
142
|
|
|
{ |
143
|
|
|
return true; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
function is_category() |
147
|
|
|
{ |
148
|
|
|
return true; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
function is_tag() |
152
|
|
|
{ |
153
|
|
|
return true; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
function is_author() |
157
|
|
|
{ |
158
|
|
|
return true; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
function is_date() |
162
|
|
|
{ |
163
|
|
|
return true; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
function is_archive() |
167
|
|
|
{ |
168
|
|
|
return true; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
function is_paged() |
172
|
|
|
{ |
173
|
|
|
return true; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
function remove_filter($tag, $function_to_remove, $priority = 10) |
|
|
|
|
177
|
|
|
{ |
178
|
|
|
return true; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
function get_template_directory() |
182
|
|
|
{ |
183
|
|
|
return 'src/themes/AppTheme/Resources/views'; |
184
|
|
|
} |
185
|
|
|
} |
186
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.