@@ -21,9 +21,12 @@ |
||
21 | 21 | <title><?php echo $title; ?></title> |
22 | 22 | <?php if ( $enqueue_wp_assets ) : ?> |
23 | 23 | <?php wp_head(); ?> |
24 | -<?php else : ?> |
|
24 | +<?php else { |
|
25 | + : ?> |
|
25 | 26 | <?php foreach ( $css as $url ) : ?> |
26 | - <link rel="stylesheet" type="text/css" href="<?php echo $url;?>"> |
|
27 | + <link rel="stylesheet" type="text/css" href="<?php echo $url; |
|
28 | +} |
|
29 | +?>"> |
|
27 | 30 | <?php endforeach; ?> |
28 | 31 | <script type="text/javascript"> |
29 | 32 | <?php echo $eei18n; ?> |
@@ -19,16 +19,16 @@ discard block |
||
19 | 19 | <html> |
20 | 20 | <head> |
21 | 21 | <title><?php echo $title; ?></title> |
22 | -<?php if ( $enqueue_wp_assets ) : ?> |
|
22 | +<?php if ($enqueue_wp_assets) : ?> |
|
23 | 23 | <?php wp_head(); ?> |
24 | 24 | <?php else : ?> |
25 | - <?php foreach ( $css as $url ) : ?> |
|
26 | - <link rel="stylesheet" type="text/css" href="<?php echo $url;?>"> |
|
25 | + <?php foreach ($css as $url) : ?> |
|
26 | + <link rel="stylesheet" type="text/css" href="<?php echo $url; ?>"> |
|
27 | 27 | <?php endforeach; ?> |
28 | 28 | <script type="text/javascript"> |
29 | 29 | <?php echo $eei18n; ?> |
30 | 30 | </script> |
31 | - <?php foreach ( $header_js as $url ) : ?> |
|
31 | + <?php foreach ($header_js as $url) : ?> |
|
32 | 32 | <script type="text/javascript" src="<?php echo $url; ?>"></script> |
33 | 33 | <?php endforeach; ?> |
34 | 34 | <?php endif; ?> |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | <div style="padding: 1em;"> |
39 | 39 | <?php echo $content; ?> |
40 | 40 | </div> |
41 | - <?php foreach ( $footer_js as $url ) : ?> |
|
41 | + <?php foreach ($footer_js as $url) : ?> |
|
42 | 42 | <script type="text/javascript" src="<?php echo $url; ?>"></script> |
43 | 43 | <?php endforeach; ?> |
44 | -<?php if ( $enqueue_wp_assets ) : ?> |
|
44 | +<?php if ($enqueue_wp_assets) : ?> |
|
45 | 45 | <?php wp_footer(); ?> |
46 | 46 | <?php endif; ?> |
47 | 47 | </body> |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | /** |
54 | 54 | * @param string $word |
55 | - * @return mixed |
|
55 | + * @return string |
|
56 | 56 | */ |
57 | 57 | public static function singularize_and_upper( $word ) { |
58 | 58 | return str_replace( ' ', '_', self::humanize( self::singularize( $word ), 'all' ) ); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | |
380 | 380 | |
381 | 381 | /** |
382 | - * @param $string |
|
382 | + * @param string $string |
|
383 | 383 | * @return string |
384 | 384 | */ |
385 | 385 | public static function add_indefinite_article($string) { |
@@ -35,357 +35,357 @@ |
||
35 | 35 | * @version $Revision 0.1 $ |
36 | 36 | */ |
37 | 37 | class EEH_Inflector{ |
38 | - // ------ CLASS METHODS ------ // |
|
39 | - // ---- Public methods ---- // |
|
40 | - // {{{ pluralize() |
|
38 | + // ------ CLASS METHODS ------ // |
|
39 | + // ---- Public methods ---- // |
|
40 | + // {{{ pluralize() |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Just calls self::pluralize and strtolower on $word and returns it |
44 | 44 | * @param string $word |
45 | 45 | * @return string |
46 | 46 | */ |
47 | - public static function pluralize_and_lower( $word ){ |
|
47 | + public static function pluralize_and_lower( $word ){ |
|
48 | 48 | return strtolower( self::pluralize( $word ) ); |
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | |
53 | - /** |
|
54 | - * @param string $word |
|
55 | - * @return mixed |
|
56 | - */ |
|
57 | - public static function singularize_and_upper( $word ) { |
|
53 | + /** |
|
54 | + * @param string $word |
|
55 | + * @return mixed |
|
56 | + */ |
|
57 | + public static function singularize_and_upper( $word ) { |
|
58 | 58 | return str_replace( ' ', '_', self::humanize( self::singularize( $word ), 'all' ) ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * Pluralizes English nouns. |
|
65 | - * |
|
66 | - * @access public |
|
67 | - * @static |
|
68 | - * @param string $word English noun to pluralize |
|
69 | - * @return string Plural noun |
|
70 | - */ |
|
71 | - public static function pluralize($word){ |
|
72 | - $plural = array( |
|
73 | - '/(quiz)$/i' => '\1zes', |
|
74 | - '/^(ox)$/i' => '\1en', |
|
75 | - '/([m|l])ouse$/i' => '\1ice', |
|
76 | - '/(matr|vert|ind)ix|ex$/i' => '\1ices', |
|
77 | - '/(x|ch|ss|sh)$/i' => '\1es', |
|
78 | - '/([^aeiouy]|qu)ies$/i' => '\1y', |
|
79 | - '/([^aeiouy]|qu)y$/i' => '\1ies', |
|
80 | - '/(hive)$/i' => '\1s', |
|
81 | - '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', |
|
82 | - '/sis$/i' => 'ses', |
|
83 | - '/([ti])um$/i' => '\1a', |
|
84 | - '/(buffal|tomat)o$/i' => '\1oes', |
|
85 | - '/(bu)s$/i' => '\1ses', |
|
86 | - '/(alias|status)/i' => '\1es', |
|
87 | - '/(octop|vir)us$/i' => '\1i', |
|
88 | - '/(ax|test)is$/i' => '\1es', |
|
89 | - '/s$/i' => 's', |
|
90 | - '/$/' => 's'); |
|
91 | - |
|
92 | - $uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep'); |
|
93 | - |
|
94 | - $irregular = array( |
|
95 | - 'person' => 'people', |
|
96 | - 'man' => 'men', |
|
97 | - 'child' => 'children', |
|
98 | - 'sex' => 'sexes', |
|
99 | - 'move' => 'moves'); |
|
100 | - |
|
101 | - $lowercased_word = strtolower($word); |
|
102 | - |
|
103 | - foreach($uncountable as $_uncountable){ |
|
104 | - if(substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable && //even though the word "price" ends in "rice", it can be pluralized, so check the previous character isnt a letter |
|
63 | + /** |
|
64 | + * Pluralizes English nouns. |
|
65 | + * |
|
66 | + * @access public |
|
67 | + * @static |
|
68 | + * @param string $word English noun to pluralize |
|
69 | + * @return string Plural noun |
|
70 | + */ |
|
71 | + public static function pluralize($word){ |
|
72 | + $plural = array( |
|
73 | + '/(quiz)$/i' => '\1zes', |
|
74 | + '/^(ox)$/i' => '\1en', |
|
75 | + '/([m|l])ouse$/i' => '\1ice', |
|
76 | + '/(matr|vert|ind)ix|ex$/i' => '\1ices', |
|
77 | + '/(x|ch|ss|sh)$/i' => '\1es', |
|
78 | + '/([^aeiouy]|qu)ies$/i' => '\1y', |
|
79 | + '/([^aeiouy]|qu)y$/i' => '\1ies', |
|
80 | + '/(hive)$/i' => '\1s', |
|
81 | + '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', |
|
82 | + '/sis$/i' => 'ses', |
|
83 | + '/([ti])um$/i' => '\1a', |
|
84 | + '/(buffal|tomat)o$/i' => '\1oes', |
|
85 | + '/(bu)s$/i' => '\1ses', |
|
86 | + '/(alias|status)/i' => '\1es', |
|
87 | + '/(octop|vir)us$/i' => '\1i', |
|
88 | + '/(ax|test)is$/i' => '\1es', |
|
89 | + '/s$/i' => 's', |
|
90 | + '/$/' => 's'); |
|
91 | + |
|
92 | + $uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep'); |
|
93 | + |
|
94 | + $irregular = array( |
|
95 | + 'person' => 'people', |
|
96 | + 'man' => 'men', |
|
97 | + 'child' => 'children', |
|
98 | + 'sex' => 'sexes', |
|
99 | + 'move' => 'moves'); |
|
100 | + |
|
101 | + $lowercased_word = strtolower($word); |
|
102 | + |
|
103 | + foreach($uncountable as $_uncountable){ |
|
104 | + if(substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable && //even though the word "price" ends in "rice", it can be pluralized, so check the previous character isnt a letter |
|
105 | 105 | ! ctype_alpha( $lowercased_word[ strlen( $lowercased_word ) - strlen($_uncountable) ] ) ){ |
106 | - return $word; |
|
107 | - } |
|
108 | - } |
|
109 | - |
|
110 | - foreach($irregular as $_plural => $_singular){ |
|
111 | - if(preg_match('/(' . $_plural . ')$/i', $word, $arr)){ |
|
112 | - return preg_replace('/(' . $_plural . ')$/i', substr($arr[0], 0, 1) . substr($_singular, 1), $word); |
|
113 | - } |
|
114 | - } |
|
115 | - |
|
116 | - foreach($plural as $rule => $replacement){ |
|
117 | - if(preg_match($rule, $word)){ |
|
118 | - return preg_replace($rule, $replacement, $word); |
|
119 | - } |
|
120 | - } |
|
121 | - return false; |
|
122 | - } |
|
123 | - |
|
124 | - // }}} |
|
125 | - // {{{ singularize() |
|
126 | - |
|
127 | - /** |
|
128 | - * Singularizes English nouns. |
|
129 | - * |
|
130 | - * @access public |
|
131 | - * @static |
|
132 | - * @param string $word English noun to singularize |
|
133 | - * @return string Singular noun. |
|
134 | - */ |
|
135 | - public static function singularize($word){ |
|
136 | - $singular = array( |
|
137 | - '/(quiz)zes$/i' => '\1', |
|
138 | - '/(matr)ices$/i' => '\1ix', |
|
139 | - '/(vert|ind)ices$/i' => '\1ex', |
|
140 | - '/^(ox)en/i' => '\1', |
|
141 | - '/(alias|status)es$/i' => '\1', |
|
142 | - '/([octop|vir])i$/i' => '\1us', |
|
143 | - '/(cris|ax|test)es$/i' => '\1is', |
|
144 | - '/(shoe)s$/i' => '\1', |
|
145 | - '/(o)es$/i' => '\1', |
|
146 | - '/(bus)es$/i' => '\1', |
|
147 | - '/([m|l])ice$/i' => '\1ouse', |
|
148 | - '/(x|ch|ss|sh)es$/i' => '\1', |
|
149 | - '/(m)ovies$/i' => '\1ovie', |
|
150 | - '/(s)eries$/i' => '\1eries', |
|
151 | - '/([^aeiouy]|qu)ies$/i' => '\1y', |
|
152 | - '/([lr])ves$/i' => '\1f', |
|
153 | - '/(tive)s$/i' => '\1', |
|
154 | - '/(hive)s$/i' => '\1', |
|
155 | - '/([^f])ves$/i' => '\1fe', |
|
156 | - '/(^analy)ses$/i' => '\1sis', |
|
157 | - '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', |
|
158 | - '/([ti])a$/i' => '\1um', |
|
159 | - '/(n)ews$/i' => '\1ews', |
|
160 | - '/s$/i' => '', |
|
161 | - ); |
|
162 | - |
|
163 | - $uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep'); |
|
164 | - |
|
165 | - $irregular = array( |
|
166 | - 'person' => 'people', |
|
167 | - 'man' => 'men', |
|
168 | - 'child' => 'children', |
|
169 | - 'sex' => 'sexes', |
|
170 | - 'move' => 'moves'); |
|
171 | - |
|
172 | - $lowercased_word = strtolower($word); |
|
173 | - foreach($uncountable as $_uncountable){ |
|
174 | - if(substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable){ |
|
175 | - return $word; |
|
176 | - } |
|
177 | - } |
|
178 | - |
|
179 | - foreach($irregular as $_plural => $_singular){ |
|
180 | - if(preg_match('/(' . $_singular . ')$/i', $word, $arr)){ |
|
181 | - return preg_replace('/(' . $_singular . ')$/i', substr($arr[0], 0, 1) . substr($_plural, 1), $word); |
|
182 | - } |
|
183 | - } |
|
184 | - |
|
185 | - foreach($singular as $rule => $replacement){ |
|
186 | - if(preg_match($rule, $word)){ |
|
187 | - return preg_replace($rule, $replacement, $word); |
|
188 | - } |
|
189 | - } |
|
190 | - |
|
191 | - return $word; |
|
192 | - } |
|
193 | - |
|
194 | - // }}} |
|
195 | - // {{{ titleize() |
|
196 | - |
|
197 | - /** |
|
198 | - * Converts an underscored or CamelCase word into a English |
|
199 | - * sentence. |
|
200 | - * |
|
201 | - * The titleize static function converts text like "WelcomePage", |
|
202 | - * "welcome_page" or "welcome page" to this "Welcome |
|
203 | - * Page". |
|
204 | - * If second parameter is set to 'first' it will only |
|
205 | - * capitalize the first character of the title. |
|
206 | - * |
|
207 | - * @access public |
|
208 | - * @static |
|
209 | - * @param string $word Word to format as tile |
|
210 | - * @param string $uppercase If set to 'first' it will only uppercase the |
|
211 | - * first character. Otherwise it will uppercase all |
|
212 | - * the words in the title. |
|
213 | - * @return string Text formatted as title |
|
214 | - */ |
|
215 | - public static function titleize($word, $uppercase = ''){ |
|
216 | - $uppercase = $uppercase === 'first' ? 'ucfirst' : 'ucwords'; |
|
217 | - return $uppercase(EEH_Inflector::humanize(EEH_Inflector::underscore($word))); |
|
218 | - } |
|
219 | - |
|
220 | - // }}} |
|
221 | - // {{{ camelize() |
|
222 | - |
|
223 | - /** |
|
224 | - * Returns given word as CamelCased |
|
225 | - * |
|
226 | - * Converts a word like "send_email" to "SendEmail". It |
|
227 | - * will remove non alphanumeric character from the word, so |
|
228 | - * "who's online" will be converted to "WhoSOnline" |
|
229 | - * |
|
230 | - * @access public |
|
231 | - * @static |
|
232 | - * @see variablize |
|
233 | - * @param string $word Word to convert to camel case |
|
234 | - * @return string UpperCamelCasedWord |
|
235 | - */ |
|
236 | - public static function camelize($word){ |
|
237 | - return str_replace(' ', '', ucwords(preg_replace('/[^A-Z^a-z^0-9]+/', ' ', $word))); |
|
238 | - } |
|
239 | - |
|
240 | - // }}} |
|
241 | - // {{{ underscore() |
|
242 | - |
|
243 | - /** |
|
244 | - * Converts a word "into_it_s_underscored_version" |
|
245 | - * |
|
246 | - * Convert any "CamelCased" or "ordinary Word" into an |
|
247 | - * "underscored_word". |
|
248 | - * |
|
249 | - * This can be really useful for creating friendly URLs. |
|
250 | - * |
|
251 | - * @access public |
|
252 | - * @static |
|
253 | - * @param string $word Word to underscore |
|
254 | - * @return string Underscored word |
|
255 | - */ |
|
256 | - public static function underscore($word){ |
|
257 | - return strtolower(preg_replace('/[^A-Z^a-z^0-9]+/', '_', preg_replace('/([a-zd])([A-Z])/', '1_2', preg_replace('/([A-Z]+)([A-Z][a-z])/', '1_2', $word)))); |
|
258 | - } |
|
259 | - |
|
260 | - // }}} |
|
261 | - // {{{ humanize() |
|
262 | - |
|
263 | - /** |
|
264 | - * Returns a human-readable string from $word |
|
265 | - * |
|
266 | - * Returns a human-readable string from $word, by replacing |
|
267 | - * underscores with a space, and by upper-casing the initial |
|
268 | - * character by default. |
|
269 | - * |
|
270 | - * If you need to uppercase all the words you just have to |
|
271 | - * pass 'all' as a second parameter. |
|
272 | - * |
|
273 | - * @access public |
|
274 | - * @static |
|
275 | - * @param string $word String to "humanize" |
|
276 | - * @param string $uppercase If set to 'all' it will uppercase all the words |
|
277 | - * instead of just the first one. |
|
278 | - * @return string Human-readable word |
|
279 | - */ |
|
280 | - public static function humanize($word, $uppercase = ''){ |
|
106 | + return $word; |
|
107 | + } |
|
108 | + } |
|
109 | + |
|
110 | + foreach($irregular as $_plural => $_singular){ |
|
111 | + if(preg_match('/(' . $_plural . ')$/i', $word, $arr)){ |
|
112 | + return preg_replace('/(' . $_plural . ')$/i', substr($arr[0], 0, 1) . substr($_singular, 1), $word); |
|
113 | + } |
|
114 | + } |
|
115 | + |
|
116 | + foreach($plural as $rule => $replacement){ |
|
117 | + if(preg_match($rule, $word)){ |
|
118 | + return preg_replace($rule, $replacement, $word); |
|
119 | + } |
|
120 | + } |
|
121 | + return false; |
|
122 | + } |
|
123 | + |
|
124 | + // }}} |
|
125 | + // {{{ singularize() |
|
126 | + |
|
127 | + /** |
|
128 | + * Singularizes English nouns. |
|
129 | + * |
|
130 | + * @access public |
|
131 | + * @static |
|
132 | + * @param string $word English noun to singularize |
|
133 | + * @return string Singular noun. |
|
134 | + */ |
|
135 | + public static function singularize($word){ |
|
136 | + $singular = array( |
|
137 | + '/(quiz)zes$/i' => '\1', |
|
138 | + '/(matr)ices$/i' => '\1ix', |
|
139 | + '/(vert|ind)ices$/i' => '\1ex', |
|
140 | + '/^(ox)en/i' => '\1', |
|
141 | + '/(alias|status)es$/i' => '\1', |
|
142 | + '/([octop|vir])i$/i' => '\1us', |
|
143 | + '/(cris|ax|test)es$/i' => '\1is', |
|
144 | + '/(shoe)s$/i' => '\1', |
|
145 | + '/(o)es$/i' => '\1', |
|
146 | + '/(bus)es$/i' => '\1', |
|
147 | + '/([m|l])ice$/i' => '\1ouse', |
|
148 | + '/(x|ch|ss|sh)es$/i' => '\1', |
|
149 | + '/(m)ovies$/i' => '\1ovie', |
|
150 | + '/(s)eries$/i' => '\1eries', |
|
151 | + '/([^aeiouy]|qu)ies$/i' => '\1y', |
|
152 | + '/([lr])ves$/i' => '\1f', |
|
153 | + '/(tive)s$/i' => '\1', |
|
154 | + '/(hive)s$/i' => '\1', |
|
155 | + '/([^f])ves$/i' => '\1fe', |
|
156 | + '/(^analy)ses$/i' => '\1sis', |
|
157 | + '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', |
|
158 | + '/([ti])a$/i' => '\1um', |
|
159 | + '/(n)ews$/i' => '\1ews', |
|
160 | + '/s$/i' => '', |
|
161 | + ); |
|
162 | + |
|
163 | + $uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep'); |
|
164 | + |
|
165 | + $irregular = array( |
|
166 | + 'person' => 'people', |
|
167 | + 'man' => 'men', |
|
168 | + 'child' => 'children', |
|
169 | + 'sex' => 'sexes', |
|
170 | + 'move' => 'moves'); |
|
171 | + |
|
172 | + $lowercased_word = strtolower($word); |
|
173 | + foreach($uncountable as $_uncountable){ |
|
174 | + if(substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable){ |
|
175 | + return $word; |
|
176 | + } |
|
177 | + } |
|
178 | + |
|
179 | + foreach($irregular as $_plural => $_singular){ |
|
180 | + if(preg_match('/(' . $_singular . ')$/i', $word, $arr)){ |
|
181 | + return preg_replace('/(' . $_singular . ')$/i', substr($arr[0], 0, 1) . substr($_plural, 1), $word); |
|
182 | + } |
|
183 | + } |
|
184 | + |
|
185 | + foreach($singular as $rule => $replacement){ |
|
186 | + if(preg_match($rule, $word)){ |
|
187 | + return preg_replace($rule, $replacement, $word); |
|
188 | + } |
|
189 | + } |
|
190 | + |
|
191 | + return $word; |
|
192 | + } |
|
193 | + |
|
194 | + // }}} |
|
195 | + // {{{ titleize() |
|
196 | + |
|
197 | + /** |
|
198 | + * Converts an underscored or CamelCase word into a English |
|
199 | + * sentence. |
|
200 | + * |
|
201 | + * The titleize static function converts text like "WelcomePage", |
|
202 | + * "welcome_page" or "welcome page" to this "Welcome |
|
203 | + * Page". |
|
204 | + * If second parameter is set to 'first' it will only |
|
205 | + * capitalize the first character of the title. |
|
206 | + * |
|
207 | + * @access public |
|
208 | + * @static |
|
209 | + * @param string $word Word to format as tile |
|
210 | + * @param string $uppercase If set to 'first' it will only uppercase the |
|
211 | + * first character. Otherwise it will uppercase all |
|
212 | + * the words in the title. |
|
213 | + * @return string Text formatted as title |
|
214 | + */ |
|
215 | + public static function titleize($word, $uppercase = ''){ |
|
216 | + $uppercase = $uppercase === 'first' ? 'ucfirst' : 'ucwords'; |
|
217 | + return $uppercase(EEH_Inflector::humanize(EEH_Inflector::underscore($word))); |
|
218 | + } |
|
219 | + |
|
220 | + // }}} |
|
221 | + // {{{ camelize() |
|
222 | + |
|
223 | + /** |
|
224 | + * Returns given word as CamelCased |
|
225 | + * |
|
226 | + * Converts a word like "send_email" to "SendEmail". It |
|
227 | + * will remove non alphanumeric character from the word, so |
|
228 | + * "who's online" will be converted to "WhoSOnline" |
|
229 | + * |
|
230 | + * @access public |
|
231 | + * @static |
|
232 | + * @see variablize |
|
233 | + * @param string $word Word to convert to camel case |
|
234 | + * @return string UpperCamelCasedWord |
|
235 | + */ |
|
236 | + public static function camelize($word){ |
|
237 | + return str_replace(' ', '', ucwords(preg_replace('/[^A-Z^a-z^0-9]+/', ' ', $word))); |
|
238 | + } |
|
239 | + |
|
240 | + // }}} |
|
241 | + // {{{ underscore() |
|
242 | + |
|
243 | + /** |
|
244 | + * Converts a word "into_it_s_underscored_version" |
|
245 | + * |
|
246 | + * Convert any "CamelCased" or "ordinary Word" into an |
|
247 | + * "underscored_word". |
|
248 | + * |
|
249 | + * This can be really useful for creating friendly URLs. |
|
250 | + * |
|
251 | + * @access public |
|
252 | + * @static |
|
253 | + * @param string $word Word to underscore |
|
254 | + * @return string Underscored word |
|
255 | + */ |
|
256 | + public static function underscore($word){ |
|
257 | + return strtolower(preg_replace('/[^A-Z^a-z^0-9]+/', '_', preg_replace('/([a-zd])([A-Z])/', '1_2', preg_replace('/([A-Z]+)([A-Z][a-z])/', '1_2', $word)))); |
|
258 | + } |
|
259 | + |
|
260 | + // }}} |
|
261 | + // {{{ humanize() |
|
262 | + |
|
263 | + /** |
|
264 | + * Returns a human-readable string from $word |
|
265 | + * |
|
266 | + * Returns a human-readable string from $word, by replacing |
|
267 | + * underscores with a space, and by upper-casing the initial |
|
268 | + * character by default. |
|
269 | + * |
|
270 | + * If you need to uppercase all the words you just have to |
|
271 | + * pass 'all' as a second parameter. |
|
272 | + * |
|
273 | + * @access public |
|
274 | + * @static |
|
275 | + * @param string $word String to "humanize" |
|
276 | + * @param string $uppercase If set to 'all' it will uppercase all the words |
|
277 | + * instead of just the first one. |
|
278 | + * @return string Human-readable word |
|
279 | + */ |
|
280 | + public static function humanize($word, $uppercase = ''){ |
|
281 | 281 | //make special exceptions for acronyms |
282 | 282 | $word = str_replace('wp_', 'WP_', $word ); |
283 | - $uppercase = $uppercase === 'all' ? 'ucwords' : 'ucfirst'; |
|
284 | - return $uppercase(str_replace('_', ' ', preg_replace('/_id$/', '', $word))); |
|
285 | - } |
|
286 | - |
|
287 | - // }}} |
|
288 | - // {{{ variablize() |
|
289 | - |
|
290 | - /** |
|
291 | - * Same as camelize but first char is underscored |
|
292 | - * |
|
293 | - * Converts a word like "send_email" to "sendEmail". It |
|
294 | - * will remove non alphanumeric character from the word, so |
|
295 | - * "who's online" will be converted to "whoSOnline" |
|
296 | - * |
|
297 | - * @access public |
|
298 | - * @static |
|
299 | - * @see camelize |
|
300 | - * @param string $word Word to lowerCamelCase |
|
301 | - * @return string Returns a lowerCamelCasedWord |
|
302 | - */ |
|
303 | - public static function variablize($word){ |
|
304 | - $word = EEH_Inflector::camelize($word); |
|
305 | - return strtolower($word[0]) . substr($word, 1); |
|
306 | - } |
|
307 | - |
|
308 | - // }}} |
|
309 | - // {{{ tableize() |
|
310 | - |
|
311 | - /** |
|
312 | - * Converts a class name to its table name according to rails |
|
313 | - * naming conventions. |
|
314 | - * |
|
315 | - * Converts "Person" to "people" |
|
316 | - * |
|
317 | - * @access public |
|
318 | - * @static |
|
319 | - * @see classify |
|
320 | - * @param string $class_name Class name for getting related table_name. |
|
321 | - * @return string plural_table_name |
|
322 | - */ |
|
323 | - public static function tableize($class_name){ |
|
324 | - return EEH_Inflector::pluralize(EEH_Inflector::underscore($class_name)); |
|
325 | - } |
|
326 | - |
|
327 | - // }}} |
|
328 | - // {{{ classify() |
|
329 | - |
|
330 | - /** |
|
331 | - * Converts a table name to its class name according to rails |
|
332 | - * naming conventions. |
|
333 | - * |
|
334 | - * Converts "people" to "Person" |
|
335 | - * |
|
336 | - * @access public |
|
337 | - * @static |
|
338 | - * @see tableize |
|
339 | - * @param string $table_name Table name for getting related ClassName. |
|
340 | - * @return string SingularClassName |
|
341 | - */ |
|
342 | - public static function classify($table_name){ |
|
343 | - return EEH_Inflector::camelize(EEH_Inflector::singularize($table_name)); |
|
344 | - } |
|
345 | - |
|
346 | - // }}} |
|
347 | - // {{{ ordinalize() |
|
348 | - |
|
349 | - /** |
|
350 | - * Converts number to its ordinal English form. |
|
351 | - * |
|
352 | - * This method converts 13 to 13th, 2 to 2nd ... |
|
353 | - * |
|
354 | - * @access public |
|
355 | - * @static |
|
356 | - * @param integer $number Number to get its ordinal value |
|
357 | - * @return string Ordinal representation of given string. |
|
358 | - */ |
|
359 | - public static function ordinalize($number){ |
|
360 | - if(in_array(($number % 100), range(11, 13))){ |
|
361 | - return $number . 'th'; |
|
362 | - }else{ |
|
363 | - switch(($number % 10)){ |
|
364 | - case 1: |
|
365 | - return $number . 'st'; |
|
366 | - break; |
|
367 | - case 2: |
|
368 | - return $number . 'nd'; |
|
369 | - break; |
|
370 | - case 3: |
|
371 | - return $number . 'rd'; |
|
372 | - default: |
|
373 | - return $number . 'th'; |
|
374 | - break; |
|
375 | - } |
|
376 | - } |
|
377 | - } |
|
378 | - |
|
379 | - |
|
380 | - |
|
381 | - /** |
|
382 | - * @param $string |
|
383 | - * @return string |
|
384 | - */ |
|
385 | - public static function add_indefinite_article($string) { |
|
386 | - if (strtolower($string) === 'null') { |
|
387 | - return $string; |
|
388 | - } |
|
389 | - return (stripos('aeiou', $string[0]) !== false ? 'an ' : 'a ') . $string; |
|
390 | - } |
|
283 | + $uppercase = $uppercase === 'all' ? 'ucwords' : 'ucfirst'; |
|
284 | + return $uppercase(str_replace('_', ' ', preg_replace('/_id$/', '', $word))); |
|
285 | + } |
|
286 | + |
|
287 | + // }}} |
|
288 | + // {{{ variablize() |
|
289 | + |
|
290 | + /** |
|
291 | + * Same as camelize but first char is underscored |
|
292 | + * |
|
293 | + * Converts a word like "send_email" to "sendEmail". It |
|
294 | + * will remove non alphanumeric character from the word, so |
|
295 | + * "who's online" will be converted to "whoSOnline" |
|
296 | + * |
|
297 | + * @access public |
|
298 | + * @static |
|
299 | + * @see camelize |
|
300 | + * @param string $word Word to lowerCamelCase |
|
301 | + * @return string Returns a lowerCamelCasedWord |
|
302 | + */ |
|
303 | + public static function variablize($word){ |
|
304 | + $word = EEH_Inflector::camelize($word); |
|
305 | + return strtolower($word[0]) . substr($word, 1); |
|
306 | + } |
|
307 | + |
|
308 | + // }}} |
|
309 | + // {{{ tableize() |
|
310 | + |
|
311 | + /** |
|
312 | + * Converts a class name to its table name according to rails |
|
313 | + * naming conventions. |
|
314 | + * |
|
315 | + * Converts "Person" to "people" |
|
316 | + * |
|
317 | + * @access public |
|
318 | + * @static |
|
319 | + * @see classify |
|
320 | + * @param string $class_name Class name for getting related table_name. |
|
321 | + * @return string plural_table_name |
|
322 | + */ |
|
323 | + public static function tableize($class_name){ |
|
324 | + return EEH_Inflector::pluralize(EEH_Inflector::underscore($class_name)); |
|
325 | + } |
|
326 | + |
|
327 | + // }}} |
|
328 | + // {{{ classify() |
|
329 | + |
|
330 | + /** |
|
331 | + * Converts a table name to its class name according to rails |
|
332 | + * naming conventions. |
|
333 | + * |
|
334 | + * Converts "people" to "Person" |
|
335 | + * |
|
336 | + * @access public |
|
337 | + * @static |
|
338 | + * @see tableize |
|
339 | + * @param string $table_name Table name for getting related ClassName. |
|
340 | + * @return string SingularClassName |
|
341 | + */ |
|
342 | + public static function classify($table_name){ |
|
343 | + return EEH_Inflector::camelize(EEH_Inflector::singularize($table_name)); |
|
344 | + } |
|
345 | + |
|
346 | + // }}} |
|
347 | + // {{{ ordinalize() |
|
348 | + |
|
349 | + /** |
|
350 | + * Converts number to its ordinal English form. |
|
351 | + * |
|
352 | + * This method converts 13 to 13th, 2 to 2nd ... |
|
353 | + * |
|
354 | + * @access public |
|
355 | + * @static |
|
356 | + * @param integer $number Number to get its ordinal value |
|
357 | + * @return string Ordinal representation of given string. |
|
358 | + */ |
|
359 | + public static function ordinalize($number){ |
|
360 | + if(in_array(($number % 100), range(11, 13))){ |
|
361 | + return $number . 'th'; |
|
362 | + }else{ |
|
363 | + switch(($number % 10)){ |
|
364 | + case 1: |
|
365 | + return $number . 'st'; |
|
366 | + break; |
|
367 | + case 2: |
|
368 | + return $number . 'nd'; |
|
369 | + break; |
|
370 | + case 3: |
|
371 | + return $number . 'rd'; |
|
372 | + default: |
|
373 | + return $number . 'th'; |
|
374 | + break; |
|
375 | + } |
|
376 | + } |
|
377 | + } |
|
378 | + |
|
379 | + |
|
380 | + |
|
381 | + /** |
|
382 | + * @param $string |
|
383 | + * @return string |
|
384 | + */ |
|
385 | + public static function add_indefinite_article($string) { |
|
386 | + if (strtolower($string) === 'null') { |
|
387 | + return $string; |
|
388 | + } |
|
389 | + return (stripos('aeiou', $string[0]) !== false ? 'an ' : 'a ') . $string; |
|
390 | + } |
|
391 | 391 | } |
392 | 392 | \ No newline at end of file |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | // +----------------------------------------------------------------------+ |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @since 0.1 |
35 | 35 | * @version $Revision 0.1 $ |
36 | 36 | */ |
37 | -class EEH_Inflector{ |
|
37 | +class EEH_Inflector { |
|
38 | 38 | // ------ CLASS METHODS ------ // |
39 | 39 | // ---- Public methods ---- // |
40 | 40 | // {{{ pluralize() |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param string $word |
45 | 45 | * @return string |
46 | 46 | */ |
47 | - public static function pluralize_and_lower( $word ){ |
|
48 | - return strtolower( self::pluralize( $word ) ); |
|
47 | + public static function pluralize_and_lower($word) { |
|
48 | + return strtolower(self::pluralize($word)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | * @param string $word |
55 | 55 | * @return mixed |
56 | 56 | */ |
57 | - public static function singularize_and_upper( $word ) { |
|
58 | - return str_replace( ' ', '_', self::humanize( self::singularize( $word ), 'all' ) ); |
|
57 | + public static function singularize_and_upper($word) { |
|
58 | + return str_replace(' ', '_', self::humanize(self::singularize($word), 'all')); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param string $word English noun to pluralize |
69 | 69 | * @return string Plural noun |
70 | 70 | */ |
71 | - public static function pluralize($word){ |
|
71 | + public static function pluralize($word) { |
|
72 | 72 | $plural = array( |
73 | 73 | '/(quiz)$/i' => '\1zes', |
74 | 74 | '/^(ox)$/i' => '\1en', |
@@ -100,21 +100,21 @@ discard block |
||
100 | 100 | |
101 | 101 | $lowercased_word = strtolower($word); |
102 | 102 | |
103 | - foreach($uncountable as $_uncountable){ |
|
104 | - if(substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable && //even though the word "price" ends in "rice", it can be pluralized, so check the previous character isnt a letter |
|
105 | - ! ctype_alpha( $lowercased_word[ strlen( $lowercased_word ) - strlen($_uncountable) ] ) ){ |
|
103 | + foreach ($uncountable as $_uncountable) { |
|
104 | + if (substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable && //even though the word "price" ends in "rice", it can be pluralized, so check the previous character isnt a letter |
|
105 | + ! ctype_alpha($lowercased_word[strlen($lowercased_word) - strlen($_uncountable)])) { |
|
106 | 106 | return $word; |
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | - foreach($irregular as $_plural => $_singular){ |
|
111 | - if(preg_match('/(' . $_plural . ')$/i', $word, $arr)){ |
|
112 | - return preg_replace('/(' . $_plural . ')$/i', substr($arr[0], 0, 1) . substr($_singular, 1), $word); |
|
110 | + foreach ($irregular as $_plural => $_singular) { |
|
111 | + if (preg_match('/('.$_plural.')$/i', $word, $arr)) { |
|
112 | + return preg_replace('/('.$_plural.')$/i', substr($arr[0], 0, 1).substr($_singular, 1), $word); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | - foreach($plural as $rule => $replacement){ |
|
117 | - if(preg_match($rule, $word)){ |
|
116 | + foreach ($plural as $rule => $replacement) { |
|
117 | + if (preg_match($rule, $word)) { |
|
118 | 118 | return preg_replace($rule, $replacement, $word); |
119 | 119 | } |
120 | 120 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @param string $word English noun to singularize |
133 | 133 | * @return string Singular noun. |
134 | 134 | */ |
135 | - public static function singularize($word){ |
|
135 | + public static function singularize($word) { |
|
136 | 136 | $singular = array( |
137 | 137 | '/(quiz)zes$/i' => '\1', |
138 | 138 | '/(matr)ices$/i' => '\1ix', |
@@ -170,20 +170,20 @@ discard block |
||
170 | 170 | 'move' => 'moves'); |
171 | 171 | |
172 | 172 | $lowercased_word = strtolower($word); |
173 | - foreach($uncountable as $_uncountable){ |
|
174 | - if(substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable){ |
|
173 | + foreach ($uncountable as $_uncountable) { |
|
174 | + if (substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable) { |
|
175 | 175 | return $word; |
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
179 | - foreach($irregular as $_plural => $_singular){ |
|
180 | - if(preg_match('/(' . $_singular . ')$/i', $word, $arr)){ |
|
181 | - return preg_replace('/(' . $_singular . ')$/i', substr($arr[0], 0, 1) . substr($_plural, 1), $word); |
|
179 | + foreach ($irregular as $_plural => $_singular) { |
|
180 | + if (preg_match('/('.$_singular.')$/i', $word, $arr)) { |
|
181 | + return preg_replace('/('.$_singular.')$/i', substr($arr[0], 0, 1).substr($_plural, 1), $word); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
185 | - foreach($singular as $rule => $replacement){ |
|
186 | - if(preg_match($rule, $word)){ |
|
185 | + foreach ($singular as $rule => $replacement) { |
|
186 | + if (preg_match($rule, $word)) { |
|
187 | 187 | return preg_replace($rule, $replacement, $word); |
188 | 188 | } |
189 | 189 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * the words in the title. |
213 | 213 | * @return string Text formatted as title |
214 | 214 | */ |
215 | - public static function titleize($word, $uppercase = ''){ |
|
215 | + public static function titleize($word, $uppercase = '') { |
|
216 | 216 | $uppercase = $uppercase === 'first' ? 'ucfirst' : 'ucwords'; |
217 | 217 | return $uppercase(EEH_Inflector::humanize(EEH_Inflector::underscore($word))); |
218 | 218 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @param string $word Word to convert to camel case |
234 | 234 | * @return string UpperCamelCasedWord |
235 | 235 | */ |
236 | - public static function camelize($word){ |
|
236 | + public static function camelize($word) { |
|
237 | 237 | return str_replace(' ', '', ucwords(preg_replace('/[^A-Z^a-z^0-9]+/', ' ', $word))); |
238 | 238 | } |
239 | 239 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @param string $word Word to underscore |
254 | 254 | * @return string Underscored word |
255 | 255 | */ |
256 | - public static function underscore($word){ |
|
256 | + public static function underscore($word) { |
|
257 | 257 | return strtolower(preg_replace('/[^A-Z^a-z^0-9]+/', '_', preg_replace('/([a-zd])([A-Z])/', '1_2', preg_replace('/([A-Z]+)([A-Z][a-z])/', '1_2', $word)))); |
258 | 258 | } |
259 | 259 | |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | * instead of just the first one. |
278 | 278 | * @return string Human-readable word |
279 | 279 | */ |
280 | - public static function humanize($word, $uppercase = ''){ |
|
280 | + public static function humanize($word, $uppercase = '') { |
|
281 | 281 | //make special exceptions for acronyms |
282 | - $word = str_replace('wp_', 'WP_', $word ); |
|
282 | + $word = str_replace('wp_', 'WP_', $word); |
|
283 | 283 | $uppercase = $uppercase === 'all' ? 'ucwords' : 'ucfirst'; |
284 | 284 | return $uppercase(str_replace('_', ' ', preg_replace('/_id$/', '', $word))); |
285 | 285 | } |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | * @param string $word Word to lowerCamelCase |
301 | 301 | * @return string Returns a lowerCamelCasedWord |
302 | 302 | */ |
303 | - public static function variablize($word){ |
|
303 | + public static function variablize($word) { |
|
304 | 304 | $word = EEH_Inflector::camelize($word); |
305 | - return strtolower($word[0]) . substr($word, 1); |
|
305 | + return strtolower($word[0]).substr($word, 1); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | // }}} |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @param string $class_name Class name for getting related table_name. |
321 | 321 | * @return string plural_table_name |
322 | 322 | */ |
323 | - public static function tableize($class_name){ |
|
323 | + public static function tableize($class_name) { |
|
324 | 324 | return EEH_Inflector::pluralize(EEH_Inflector::underscore($class_name)); |
325 | 325 | } |
326 | 326 | |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | * @param string $table_name Table name for getting related ClassName. |
340 | 340 | * @return string SingularClassName |
341 | 341 | */ |
342 | - public static function classify($table_name){ |
|
342 | + public static function classify($table_name) { |
|
343 | 343 | return EEH_Inflector::camelize(EEH_Inflector::singularize($table_name)); |
344 | 344 | } |
345 | 345 | |
@@ -356,21 +356,21 @@ discard block |
||
356 | 356 | * @param integer $number Number to get its ordinal value |
357 | 357 | * @return string Ordinal representation of given string. |
358 | 358 | */ |
359 | - public static function ordinalize($number){ |
|
360 | - if(in_array(($number % 100), range(11, 13))){ |
|
361 | - return $number . 'th'; |
|
362 | - }else{ |
|
363 | - switch(($number % 10)){ |
|
359 | + public static function ordinalize($number) { |
|
360 | + if (in_array(($number % 100), range(11, 13))) { |
|
361 | + return $number.'th'; |
|
362 | + } else { |
|
363 | + switch (($number % 10)) { |
|
364 | 364 | case 1: |
365 | - return $number . 'st'; |
|
365 | + return $number.'st'; |
|
366 | 366 | break; |
367 | 367 | case 2: |
368 | - return $number . 'nd'; |
|
368 | + return $number.'nd'; |
|
369 | 369 | break; |
370 | 370 | case 3: |
371 | - return $number . 'rd'; |
|
371 | + return $number.'rd'; |
|
372 | 372 | default: |
373 | - return $number . 'th'; |
|
373 | + return $number.'th'; |
|
374 | 374 | break; |
375 | 375 | } |
376 | 376 | } |
@@ -386,6 +386,6 @@ discard block |
||
386 | 386 | if (strtolower($string) === 'null') { |
387 | 387 | return $string; |
388 | 388 | } |
389 | - return (stripos('aeiou', $string[0]) !== false ? 'an ' : 'a ') . $string; |
|
389 | + return (stripos('aeiou', $string[0]) !== false ? 'an ' : 'a ').$string; |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | \ No newline at end of file |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php use EventEspresso\core\interfaces\ResettableInterface; |
2 | 2 | |
3 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
3 | +if ( ! defined( 'EVENT_ESPRESSO_VERSION')) { |
|
4 | + exit('No direct script access allowed'); |
|
5 | +} |
|
4 | 6 | /** |
5 | 7 | * Event Espresso |
6 | 8 | * |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use EventEspresso\core\libraries\iframe_display\EventListIframeEmbedButton; |
4 | 4 | use EventEspresso\modules\events_archive\EventsArchiveIframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
7 | 7 | /** |
8 | 8 | * Event Espresso |
9 | 9 | * |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @return EED_Events_Archive |
54 | 54 | */ |
55 | 55 | public static function instance() { |
56 | - return parent::get_instance( __CLASS__ ); |
|
56 | + return parent::get_instance(__CLASS__); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | * @return void |
66 | 66 | */ |
67 | 67 | public static function set_hooks() { |
68 | - EE_Config::register_route( EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run' ); |
|
69 | - EE_Config::register_route( 'event_list', 'Events_Archive', 'event_list' ); |
|
70 | - EE_Config::register_route( 'iframe', 'Events_Archive', 'event_list_iframe', 'event_list' ); |
|
71 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
68 | + EE_Config::register_route(EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run'); |
|
69 | + EE_Config::register_route('event_list', 'Events_Archive', 'event_list'); |
|
70 | + EE_Config::register_route('iframe', 'Events_Archive', 'event_list_iframe', 'event_list'); |
|
71 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | * @return void |
79 | 79 | */ |
80 | 80 | public static function set_hooks_admin() { |
81 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
81 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
82 | 82 | // hook into the end of the \EE_Admin_Page::_load_page_dependencies() |
83 | 83 | // to load assets for "espresso_events" page on the "default" route (action) |
84 | 84 | add_action( |
85 | 85 | 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__default', |
86 | - array( 'EED_Events_Archive', 'event_list_iframe_embed_button' ), |
|
86 | + array('EED_Events_Archive', 'event_list_iframe_embed_button'), |
|
87 | 87 | 10 |
88 | 88 | ); |
89 | 89 | } |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | * @return void |
99 | 99 | */ |
100 | 100 | public static function set_definitions() { |
101 | - define( 'EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
102 | - define( 'EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
101 | + define('EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
102 | + define('EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * set up EE_Events_Archive_Config |
109 | 109 | */ |
110 | - protected function set_config(){ |
|
111 | - $this->set_config_section( 'template_settings' ); |
|
112 | - $this->set_config_class( 'EE_Events_Archive_Config' ); |
|
113 | - $this->set_config_name( 'EED_Events_Archive' ); |
|
110 | + protected function set_config() { |
|
111 | + $this->set_config_section('template_settings'); |
|
112 | + $this->set_config_class('EE_Events_Archive_Config'); |
|
113 | + $this->set_config_name('EED_Events_Archive'); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @return EventListIframeEmbedButton |
120 | 120 | */ |
121 | 121 | public static function get_iframe_embed_button() { |
122 | - if ( ! self::$_iframe_embed_button instanceof EventListIframeEmbedButton ) { |
|
122 | + if ( ! self::$_iframe_embed_button instanceof EventListIframeEmbedButton) { |
|
123 | 123 | self::$_iframe_embed_button = new EventListIframeEmbedButton(); |
124 | 124 | } |
125 | 125 | return self::$_iframe_embed_button; |
@@ -145,35 +145,35 @@ discard block |
||
145 | 145 | * @param \EE_Events_Archive_Config $config |
146 | 146 | * @return \EE_Template_Part_Manager |
147 | 147 | */ |
148 | - public function initialize_template_parts( EE_Events_Archive_Config $config = null ) { |
|
148 | + public function initialize_template_parts(EE_Events_Archive_Config $config = null) { |
|
149 | 149 | $config = $config instanceof EE_Events_Archive_Config ? $config : $this->config(); |
150 | 150 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
151 | 151 | $template_parts = new EE_Template_Part_Manager(); |
152 | 152 | $template_parts->add_template_part( |
153 | 153 | 'tickets', |
154 | - __( 'Ticket Selector', 'event_espresso' ), |
|
154 | + __('Ticket Selector', 'event_espresso'), |
|
155 | 155 | 'content-espresso_events-tickets.php', |
156 | 156 | $config->display_order_tickets |
157 | 157 | ); |
158 | 158 | $template_parts->add_template_part( |
159 | 159 | 'datetimes', |
160 | - __( 'Dates and Times', 'event_espresso' ), |
|
160 | + __('Dates and Times', 'event_espresso'), |
|
161 | 161 | 'content-espresso_events-datetimes.php', |
162 | 162 | $config->display_order_datetimes |
163 | 163 | ); |
164 | 164 | $template_parts->add_template_part( |
165 | 165 | 'event', |
166 | - __( 'Event Description', 'event_espresso' ), |
|
166 | + __('Event Description', 'event_espresso'), |
|
167 | 167 | 'content-espresso_events-details.php', |
168 | 168 | $config->display_order_event |
169 | 169 | ); |
170 | 170 | $template_parts->add_template_part( |
171 | 171 | 'venue', |
172 | - __( 'Venue Information', 'event_espresso' ), |
|
172 | + __('Venue Information', 'event_espresso'), |
|
173 | 173 | 'content-espresso_events-venues.php', |
174 | 174 | $config->display_order_venue |
175 | 175 | ); |
176 | - do_action( 'AHEE__EED_Event_Archive__initialize_template_parts', $template_parts ); |
|
176 | + do_action('AHEE__EED_Event_Archive__initialize_template_parts', $template_parts); |
|
177 | 177 | return $template_parts; |
178 | 178 | } |
179 | 179 | |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | * @param WP $WP |
187 | 187 | * @return void |
188 | 188 | */ |
189 | - public function run( $WP ) { |
|
190 | - do_action( 'AHEE__EED_Events_Archive__before_run' ); |
|
189 | + public function run($WP) { |
|
190 | + do_action('AHEE__EED_Events_Archive__before_run'); |
|
191 | 191 | // ensure valid EE_Events_Archive_Config() object exists |
192 | 192 | $this->set_config(); |
193 | 193 | /** @type EE_Events_Archive_Config $config */ |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | EEH_Event_Query::add_query_filters(); |
200 | 200 | // set params that will get used by the filters |
201 | 201 | EEH_Event_Query::set_query_params( |
202 | - '', // month |
|
203 | - '', // category |
|
204 | - $config->display_expired_events, // show_expired |
|
205 | - 'start_date', // orderby |
|
202 | + '', // month |
|
203 | + '', // category |
|
204 | + $config->display_expired_events, // show_expired |
|
205 | + 'start_date', // orderby |
|
206 | 206 | 'ASC' // sort |
207 | 207 | ); |
208 | 208 | // check what template is loaded |
209 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
209 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @throws \EE_Error |
233 | 233 | */ |
234 | 234 | public function event_list_iframe() { |
235 | - $event_list_iframe = new EventsArchiveIframe( $this ); |
|
235 | + $event_list_iframe = new EventsArchiveIframe($this); |
|
236 | 236 | $event_list_iframe->display(); |
237 | 237 | } |
238 | 238 | |
@@ -250,32 +250,32 @@ discard block |
||
250 | 250 | * @param string $template |
251 | 251 | * @return string |
252 | 252 | */ |
253 | - public function template_include( $template = '' ) { |
|
253 | + public function template_include($template = '') { |
|
254 | 254 | // don't add content filter for dedicated EE child themes or private posts |
255 | - if ( ! EEH_Template::is_espresso_theme() ) { |
|
255 | + if ( ! EEH_Template::is_espresso_theme()) { |
|
256 | 256 | /** @type EE_Events_Archive_Config $config */ |
257 | 257 | $config = $this->config(); |
258 | 258 | // add status banner ? |
259 | - if ( $config->display_status_banner ) { |
|
260 | - add_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100, 2 ); |
|
259 | + if ($config->display_status_banner) { |
|
260 | + add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2); |
|
261 | 261 | } |
262 | 262 | // if NOT a custom template |
263 | 263 | if ( |
264 | - EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'archive-espresso_events.php' |
|
265 | - || apply_filters( 'FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', FALSE ) |
|
264 | + EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'archive-espresso_events.php' |
|
265 | + || apply_filters('FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', FALSE) |
|
266 | 266 | ) { |
267 | 267 | // don't display entry meta because the existing theme will take care of that |
268 | - add_filter( 'FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true' ); |
|
268 | + add_filter('FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true'); |
|
269 | 269 | // load functions.php file for the theme (loaded by WP if using child theme) |
270 | 270 | EEH_Template::load_espresso_theme_functions(); |
271 | 271 | // because we don't know if the theme is using the_excerpt() |
272 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
272 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
273 | 273 | // or the_content |
274 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
274 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
275 | 275 | // and just in case they are running get_the_excerpt() which DESTROYS things |
276 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
276 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
277 | 277 | // don't display entry meta because the existing theme will take care of that |
278 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
278 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | return $template; |
@@ -290,17 +290,17 @@ discard block |
||
290 | 290 | * @param string $excerpt |
291 | 291 | * @return string |
292 | 292 | */ |
293 | - public static function get_the_excerpt( $excerpt = '' ) { |
|
294 | - if ( post_password_required() ) { |
|
293 | + public static function get_the_excerpt($excerpt = '') { |
|
294 | + if (post_password_required()) { |
|
295 | 295 | return $excerpt; |
296 | 296 | } |
297 | - if ( apply_filters( 'FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false ) ) { |
|
298 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
299 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
300 | - $excerpt = EED_Events_Archive::event_details( $excerpt ); |
|
297 | + if (apply_filters('FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false)) { |
|
298 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
299 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
300 | + $excerpt = EED_Events_Archive::event_details($excerpt); |
|
301 | 301 | } else { |
302 | 302 | EED_Events_Archive::$using_get_the_excerpt = true; |
303 | - add_filter( 'wp_trim_excerpt', array( 'EED_Events_Archive', 'end_get_the_excerpt' ), 999, 1 ); |
|
303 | + add_filter('wp_trim_excerpt', array('EED_Events_Archive', 'end_get_the_excerpt'), 999, 1); |
|
304 | 304 | } |
305 | 305 | return $excerpt; |
306 | 306 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | * @param string $text |
315 | 315 | * @return string |
316 | 316 | */ |
317 | - public static function end_get_the_excerpt( $text = '' ) { |
|
317 | + public static function end_get_the_excerpt($text = '') { |
|
318 | 318 | EED_Events_Archive::$using_get_the_excerpt = false; |
319 | 319 | return $text; |
320 | 320 | } |
@@ -329,10 +329,10 @@ discard block |
||
329 | 329 | * @param string $id |
330 | 330 | * @return string |
331 | 331 | */ |
332 | - public static function the_title( $title = '', $id = '' ) { |
|
332 | + public static function the_title($title = '', $id = '') { |
|
333 | 333 | global $post; |
334 | - if ( $post instanceof WP_Post ) { |
|
335 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
334 | + if ($post instanceof WP_Post) { |
|
335 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
336 | 336 | } |
337 | 337 | return $title; |
338 | 338 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | * @param string $content |
347 | 347 | * @return string |
348 | 348 | */ |
349 | - public static function event_details( $content ) { |
|
349 | + public static function event_details($content) { |
|
350 | 350 | global $post; |
351 | 351 | static $current_post_ID = 0; |
352 | 352 | if ( |
@@ -355,8 +355,8 @@ discard block |
||
355 | 355 | && ! EED_Events_Archive::$using_get_the_excerpt |
356 | 356 | && ! post_password_required() |
357 | 357 | && ( |
358 | - apply_filters( 'FHEE__EES_Espresso_Events__process_shortcode__true', false ) |
|
359 | - || ! apply_filters( 'FHEE__content_espresso_events__template_loaded', false ) |
|
358 | + apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', false) |
|
359 | + || ! apply_filters('FHEE__content_espresso_events__template_loaded', false) |
|
360 | 360 | ) |
361 | 361 | ) { |
362 | 362 | // Set current post ID to prevent showing content twice, but only if headers have definitely been sent. |
@@ -365,8 +365,8 @@ discard block |
||
365 | 365 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
366 | 366 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
367 | 367 | // so the following allows this filter to be applied multiple times, but only once for real |
368 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
369 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order ) { |
|
368 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
369 | + if (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order) { |
|
370 | 370 | $content = \EED_Events_Archive::use_sortable_display_order(); |
371 | 371 | } else { |
372 | 372 | $content = \EED_Events_Archive::use_filterable_display_order(); |
@@ -385,20 +385,20 @@ discard block |
||
385 | 385 | */ |
386 | 386 | protected static function use_sortable_display_order() { |
387 | 387 | // no further password checks required atm |
388 | - add_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
388 | + add_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
389 | 389 | // we need to first remove this callback from being applied to the_content() or the_excerpt() (otherwise it will recurse and blow up the interweb) |
390 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
391 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
392 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
390 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
391 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
392 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
393 | 393 | // now add additional content depending on whether event is using the_excerpt() or the_content() |
394 | 394 | EED_Events_Archive::instance()->template_parts = EED_Events_Archive::instance()->initialize_template_parts(); |
395 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
396 | - $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters( $content ); |
|
395 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
396 | + $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters($content); |
|
397 | 397 | // re-add our main filters (or else the next event won't have them) |
398 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
399 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
400 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
401 | - remove_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
398 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
399 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
400 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
401 | + remove_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
402 | 402 | return $content; |
403 | 403 | } |
404 | 404 | |
@@ -413,22 +413,22 @@ discard block |
||
413 | 413 | protected static function use_filterable_display_order() { |
414 | 414 | // we need to first remove this callback from being applied to the_content() |
415 | 415 | // (otherwise it will recurse and blow up the interweb) |
416 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
417 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
418 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
416 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
417 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
418 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
419 | 419 | //now add additional content depending on whether event is using the_excerpt() or the_content() |
420 | 420 | EED_Events_Archive::_add_additional_excerpt_filters(); |
421 | 421 | EED_Events_Archive::_add_additional_content_filters(); |
422 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters' ); |
|
422 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters'); |
|
423 | 423 | // now load our template |
424 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
424 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
425 | 425 | // re-add our main filters (or else the next event won't have them) |
426 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
427 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
428 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
426 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
427 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
428 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
429 | 429 | // but remove the other filters so that they don't get applied to the next post |
430 | 430 | EED_Events_Archive::_remove_additional_events_archive_filters(); |
431 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters' ); |
|
431 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters'); |
|
432 | 432 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
433 | 433 | //return ! empty( $template ) ? $template : $content; |
434 | 434 | return $content; |
@@ -443,11 +443,11 @@ discard block |
||
443 | 443 | * @param string $content |
444 | 444 | * @return string |
445 | 445 | */ |
446 | - public static function event_datetimes( $content ) { |
|
447 | - if ( post_password_required() ) { |
|
446 | + public static function event_datetimes($content) { |
|
447 | + if (post_password_required()) { |
|
448 | 448 | return $content; |
449 | 449 | } |
450 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
450 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | /** |
@@ -457,11 +457,11 @@ discard block |
||
457 | 457 | * @param string $content |
458 | 458 | * @return string |
459 | 459 | */ |
460 | - public static function event_tickets( $content ) { |
|
461 | - if ( post_password_required() ) { |
|
460 | + public static function event_tickets($content) { |
|
461 | + if (post_password_required()) { |
|
462 | 462 | return $content; |
463 | 463 | } |
464 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
464 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | |
@@ -473,8 +473,8 @@ discard block |
||
473 | 473 | * @param string $content |
474 | 474 | * @return string |
475 | 475 | */ |
476 | - public static function event_venue( $content ) { |
|
477 | - return EED_Events_Archive::event_venues( $content ); |
|
476 | + public static function event_venue($content) { |
|
477 | + return EED_Events_Archive::event_venues($content); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | /** |
@@ -484,11 +484,11 @@ discard block |
||
484 | 484 | * @param string $content |
485 | 485 | * @return string |
486 | 486 | */ |
487 | - public static function event_venues( $content ) { |
|
488 | - if ( post_password_required() ) { |
|
487 | + public static function event_venues($content) { |
|
488 | + if (post_password_required()) { |
|
489 | 489 | return $content; |
490 | 490 | } |
491 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
491 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | |
@@ -500,9 +500,9 @@ discard block |
||
500 | 500 | * @return void |
501 | 501 | */ |
502 | 502 | private static function _add_additional_excerpt_filters() { |
503 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
504 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
505 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
503 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
504 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
505 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | |
@@ -514,9 +514,9 @@ discard block |
||
514 | 514 | * @return void |
515 | 515 | */ |
516 | 516 | private static function _add_additional_content_filters() { |
517 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
518 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
519 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
517 | + add_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
518 | + add_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
519 | + add_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | |
@@ -528,12 +528,12 @@ discard block |
||
528 | 528 | * @return void |
529 | 529 | */ |
530 | 530 | private static function _remove_additional_events_archive_filters() { |
531 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
532 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
533 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
534 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
535 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
536 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
531 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
532 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
533 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
534 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
535 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
536 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
537 | 537 | } |
538 | 538 | |
539 | 539 | |
@@ -546,17 +546,17 @@ discard block |
||
546 | 546 | */ |
547 | 547 | public static function remove_all_events_archive_filters() { |
548 | 548 | //remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
549 | - remove_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100 ); |
|
550 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
551 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
552 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
553 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
554 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
555 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
556 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
557 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
549 | + remove_filter('the_title', array('EED_Events_Archive', 'the_title'), 100); |
|
550 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
551 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
552 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
553 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
554 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
555 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
556 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
557 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
558 | 558 | // don't display entry meta because the existing theme will take care of that |
559 | - remove_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
559 | + remove_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | |
@@ -571,12 +571,12 @@ discard block |
||
571 | 571 | * @return void |
572 | 572 | */ |
573 | 573 | public function load_event_list_assets() { |
574 | - do_action( 'AHEE__EED_Events_Archive__before_load_assets' ); |
|
575 | - add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
|
576 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
577 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
578 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
579 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
574 | + do_action('AHEE__EED_Events_Archive__before_load_assets'); |
|
575 | + add_filter('FHEE_load_EE_Session', '__return_true'); |
|
576 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
577 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
578 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
579 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
580 | 580 | } |
581 | 581 | } |
582 | 582 | |
@@ -593,13 +593,13 @@ discard block |
||
593 | 593 | */ |
594 | 594 | public function wp_enqueue_scripts() { |
595 | 595 | // get some style |
596 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) { |
|
596 | + if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) { |
|
597 | 597 | // first check uploads folder |
598 | - if ( EEH_File::is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
599 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
598 | + if (EEH_File::is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
599 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
600 | 600 | } else { |
601 | 601 | } |
602 | - wp_enqueue_style( $this->theme ); |
|
602 | + wp_enqueue_style($this->theme); |
|
603 | 603 | |
604 | 604 | } |
605 | 605 | } |
@@ -617,8 +617,8 @@ discard block |
||
617 | 617 | */ |
618 | 618 | public static function template_settings_form() { |
619 | 619 | $template_settings = EE_Registry::instance()->CFG->template_settings; |
620 | - $template_settings->EED_Events_Archive = isset( $template_settings->EED_Events_Archive ) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
621 | - $template_settings->EED_Events_Archive = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive ); |
|
620 | + $template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
621 | + $template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive); |
|
622 | 622 | $events_archive_settings = array( |
623 | 623 | 'display_status_banner' => 0, |
624 | 624 | 'display_description' => 1, |
@@ -627,8 +627,8 @@ discard block |
||
627 | 627 | 'display_venue' => 0, |
628 | 628 | 'display_expired_events' => 0 |
629 | 629 | ); |
630 | - $events_archive_settings = array_merge( $events_archive_settings, (array)$template_settings->EED_Events_Archive ); |
|
631 | - EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings ); |
|
630 | + $events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive); |
|
631 | + EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $events_archive_settings); |
|
632 | 632 | } |
633 | 633 | |
634 | 634 | |
@@ -644,16 +644,16 @@ discard block |
||
644 | 644 | * @param EE_Request_Handler $REQ |
645 | 645 | * @return EE_Template_Config |
646 | 646 | */ |
647 | - public static function update_template_settings( $CFG, $REQ ) { |
|
647 | + public static function update_template_settings($CFG, $REQ) { |
|
648 | 648 | $CFG->EED_Events_Archive = new EE_Events_Archive_Config(); |
649 | 649 | // unless we are resetting the config... |
650 | - if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) { |
|
651 | - $CFG->EED_Events_Archive->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0; |
|
652 | - $CFG->EED_Events_Archive->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1; |
|
653 | - $CFG->EED_Events_Archive->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0; |
|
654 | - $CFG->EED_Events_Archive->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1; |
|
655 | - $CFG->EED_Events_Archive->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0; |
|
656 | - $CFG->EED_Events_Archive->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0; } |
|
650 | + if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) { |
|
651 | + $CFG->EED_Events_Archive->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0; |
|
652 | + $CFG->EED_Events_Archive->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1; |
|
653 | + $CFG->EED_Events_Archive->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0; |
|
654 | + $CFG->EED_Events_Archive->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1; |
|
655 | + $CFG->EED_Events_Archive->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0; |
|
656 | + $CFG->EED_Events_Archive->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0; } |
|
657 | 657 | return $CFG; |
658 | 658 | } |
659 | 659 | |
@@ -666,10 +666,10 @@ discard block |
||
666 | 666 | * @param string $extra_class |
667 | 667 | * @return string |
668 | 668 | */ |
669 | - public static function event_list_css( $extra_class = '' ) { |
|
670 | - $event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array(); |
|
669 | + public static function event_list_css($extra_class = '') { |
|
670 | + $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
671 | 671 | $event_list_css[] = 'espresso-event-list-event'; |
672 | - return implode( ' ', $event_list_css ); |
|
672 | + return implode(' ', $event_list_css); |
|
673 | 673 | } |
674 | 674 | |
675 | 675 | |
@@ -696,9 +696,9 @@ discard block |
||
696 | 696 | * @param $value |
697 | 697 | * @return bool |
698 | 698 | */ |
699 | - public static function display_description( $value ) { |
|
699 | + public static function display_description($value) { |
|
700 | 700 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
701 | - $display_description= isset( $config->display_description ) ? $config->display_description : 1; |
|
701 | + $display_description = isset($config->display_description) ? $config->display_description : 1; |
|
702 | 702 | return $display_description === $value ? TRUE : FALSE; |
703 | 703 | } |
704 | 704 | |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | */ |
712 | 712 | public static function display_ticket_selector() { |
713 | 713 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
714 | - return isset( $config->display_ticket_selector ) && $config->display_ticket_selector ? TRUE : FALSE; |
|
714 | + return isset($config->display_ticket_selector) && $config->display_ticket_selector ? TRUE : FALSE; |
|
715 | 715 | } |
716 | 716 | |
717 | 717 | |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | */ |
725 | 725 | public static function display_venue() { |
726 | 726 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
727 | - return isset( $config->display_venue ) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
727 | + return isset($config->display_venue) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | */ |
737 | 737 | public static function display_datetimes() { |
738 | 738 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
739 | - return isset( $config->display_datetimes ) && $config->display_datetimes ? TRUE : FALSE; |
|
739 | + return isset($config->display_datetimes) && $config->display_datetimes ? TRUE : FALSE; |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | * @return string |
752 | 752 | */ |
753 | 753 | public static function event_list_title() { |
754 | - return apply_filters( 'FHEE__archive_espresso_events_template__upcoming_events_h1', __( 'Upcoming Events', 'event_espresso' )); |
|
754 | + return apply_filters('FHEE__archive_espresso_events_template__upcoming_events_h1', __('Upcoming Events', 'event_espresso')); |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | |
@@ -760,11 +760,11 @@ discard block |
||
760 | 760 | /** |
761 | 761 | * @since 4.4.0 |
762 | 762 | */ |
763 | - public static function _doing_it_wrong_notice( $function = '' ) { |
|
763 | + public static function _doing_it_wrong_notice($function = '') { |
|
764 | 764 | EE_Error::doing_it_wrong( |
765 | 765 | __FUNCTION__, |
766 | 766 | sprintf( |
767 | - __( 'EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso' ), |
|
767 | + __('EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso'), |
|
768 | 768 | $function, |
769 | 769 | '<br />', |
770 | 770 | '4.6.0' |
@@ -786,89 +786,89 @@ discard block |
||
786 | 786 | * @deprecated |
787 | 787 | * @since 4.4.0 |
788 | 788 | */ |
789 | - public function posts_fields( $SQL, WP_Query $wp_query ) { |
|
790 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
791 | - return EEH_Event_Query::posts_fields( $SQL, $wp_query ); |
|
789 | + public function posts_fields($SQL, WP_Query $wp_query) { |
|
790 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
791 | + return EEH_Event_Query::posts_fields($SQL, $wp_query); |
|
792 | 792 | } |
793 | 793 | /** |
794 | 794 | * @deprecated |
795 | 795 | * @since 4.4.0 |
796 | 796 | */ |
797 | - public static function posts_fields_sql_for_orderby( $orderby_params = array() ) { |
|
798 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
799 | - return EEH_Event_Query::posts_fields_sql_for_orderby( $orderby_params ); |
|
797 | + public static function posts_fields_sql_for_orderby($orderby_params = array()) { |
|
798 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
799 | + return EEH_Event_Query::posts_fields_sql_for_orderby($orderby_params); |
|
800 | 800 | } |
801 | 801 | /** |
802 | 802 | * @deprecated |
803 | 803 | * @since 4.4.0 |
804 | 804 | */ |
805 | - public function posts_join( $SQL, WP_Query $wp_query ) { |
|
806 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
807 | - return EEH_Event_Query::posts_join( $SQL, $wp_query ); |
|
805 | + public function posts_join($SQL, WP_Query $wp_query) { |
|
806 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
807 | + return EEH_Event_Query::posts_join($SQL, $wp_query); |
|
808 | 808 | } |
809 | 809 | /** |
810 | 810 | * @deprecated |
811 | 811 | * @since 4.4.0 |
812 | 812 | */ |
813 | - public static function posts_join_sql_for_terms( $join_terms = NULL ) { |
|
814 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
815 | - return EEH_Event_Query::posts_join_sql_for_terms( $join_terms ); |
|
813 | + public static function posts_join_sql_for_terms($join_terms = NULL) { |
|
814 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
815 | + return EEH_Event_Query::posts_join_sql_for_terms($join_terms); |
|
816 | 816 | } |
817 | 817 | /** |
818 | 818 | * @deprecated |
819 | 819 | * @since 4.4.0 |
820 | 820 | */ |
821 | - public static function posts_join_for_orderby( $orderby_params = array() ) { |
|
822 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
823 | - return EEH_Event_Query::posts_join_for_orderby( $orderby_params ); |
|
821 | + public static function posts_join_for_orderby($orderby_params = array()) { |
|
822 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
823 | + return EEH_Event_Query::posts_join_for_orderby($orderby_params); |
|
824 | 824 | } |
825 | 825 | /** |
826 | 826 | * @deprecated |
827 | 827 | * @since 4.4.0 |
828 | 828 | */ |
829 | - public function posts_where( $SQL, WP_Query $wp_query ) { |
|
830 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
831 | - return EEH_Event_Query::posts_where( $SQL, $wp_query ); |
|
829 | + public function posts_where($SQL, WP_Query $wp_query) { |
|
830 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
831 | + return EEH_Event_Query::posts_where($SQL, $wp_query); |
|
832 | 832 | } |
833 | 833 | /** |
834 | 834 | * @deprecated |
835 | 835 | * @since 4.4.0 |
836 | 836 | */ |
837 | - public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) { |
|
838 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
839 | - return EEH_Event_Query::posts_where_sql_for_show_expired( $show_expired ); |
|
837 | + public static function posts_where_sql_for_show_expired($show_expired = FALSE) { |
|
838 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
839 | + return EEH_Event_Query::posts_where_sql_for_show_expired($show_expired); |
|
840 | 840 | } |
841 | 841 | /** |
842 | 842 | * @deprecated |
843 | 843 | * @since 4.4.0 |
844 | 844 | */ |
845 | - public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) { |
|
846 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
847 | - return EEH_Event_Query::posts_where_sql_for_event_category_slug( $event_category_slug ); |
|
845 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) { |
|
846 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
847 | + return EEH_Event_Query::posts_where_sql_for_event_category_slug($event_category_slug); |
|
848 | 848 | } |
849 | 849 | /** |
850 | 850 | * @deprecated |
851 | 851 | * @since 4.4.0 |
852 | 852 | */ |
853 | - public static function posts_where_sql_for_event_list_month( $month = NULL ) { |
|
854 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
855 | - return EEH_Event_Query::posts_where_sql_for_event_list_month( $month ); |
|
853 | + public static function posts_where_sql_for_event_list_month($month = NULL) { |
|
854 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
855 | + return EEH_Event_Query::posts_where_sql_for_event_list_month($month); |
|
856 | 856 | } |
857 | 857 | /** |
858 | 858 | * @deprecated |
859 | 859 | * @since 4.4.0 |
860 | 860 | */ |
861 | - public function posts_orderby( $SQL, WP_Query $wp_query ) { |
|
862 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
863 | - return EEH_Event_Query::posts_orderby( $SQL, $wp_query ); |
|
861 | + public function posts_orderby($SQL, WP_Query $wp_query) { |
|
862 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
863 | + return EEH_Event_Query::posts_orderby($SQL, $wp_query); |
|
864 | 864 | } |
865 | 865 | /** |
866 | 866 | * @deprecated |
867 | 867 | * @since 4.4.0 |
868 | 868 | */ |
869 | - public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) { |
|
870 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
871 | - return EEH_Event_Query::posts_orderby_sql( $orderby_params, $sort ); |
|
869 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') { |
|
870 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
871 | + return EEH_Event_Query::posts_orderby_sql($orderby_params, $sort); |
|
872 | 872 | } |
873 | 873 | |
874 | 874 | |
@@ -899,8 +899,8 @@ discard block |
||
899 | 899 | * @param string $extra_class |
900 | 900 | * @return string |
901 | 901 | */ |
902 | -function espresso_event_list_css( $extra_class = '' ) { |
|
903 | - return EED_Events_Archive::event_list_css( $extra_class ); |
|
902 | +function espresso_event_list_css($extra_class = '') { |
|
903 | + return EED_Events_Archive::event_list_css($extra_class); |
|
904 | 904 | } |
905 | 905 | |
906 | 906 | /** |
@@ -914,14 +914,14 @@ discard block |
||
914 | 914 | * @return bool |
915 | 915 | */ |
916 | 916 | function espresso_display_full_description_in_event_list() { |
917 | - return EED_Events_Archive::display_description( 2 ); |
|
917 | + return EED_Events_Archive::display_description(2); |
|
918 | 918 | } |
919 | 919 | |
920 | 920 | /** |
921 | 921 | * @return bool |
922 | 922 | */ |
923 | 923 | function espresso_display_excerpt_in_event_list() { |
924 | - return EED_Events_Archive::display_description( 1 ); |
|
924 | + return EED_Events_Archive::display_description(1); |
|
925 | 925 | } |
926 | 926 | |
927 | 927 | /** |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected static $using_get_the_excerpt = false; |
39 | 39 | |
40 | - /** |
|
41 | - * Used to flag when the event list is being called from an external iframe. |
|
42 | - * |
|
43 | - * @var bool $iframe |
|
44 | - */ |
|
45 | - protected static $iframe = false; |
|
46 | - |
|
47 | - /** |
|
40 | + /** |
|
41 | + * Used to flag when the event list is being called from an external iframe. |
|
42 | + * |
|
43 | + * @var bool $iframe |
|
44 | + */ |
|
45 | + protected static $iframe = false; |
|
46 | + |
|
47 | + /** |
|
48 | 48 | * @var \EventEspresso\core\libraries\iframe_display\EventListIframeEmbedButton $_iframe_embed_button |
49 | 49 | */ |
50 | 50 | private static $_iframe_embed_button; |
51 | 51 | |
52 | - /** |
|
52 | + /** |
|
53 | 53 | * @type EE_Template_Part_Manager $template_parts |
54 | 54 | */ |
55 | 55 | protected $template_parts; |
@@ -233,26 +233,26 @@ discard block |
||
233 | 233 | |
234 | 234 | |
235 | 235 | |
236 | - /** |
|
237 | - * @access public |
|
238 | - * @return void |
|
239 | - * @throws \EE_Error |
|
240 | - * @throws \DomainException |
|
241 | - */ |
|
236 | + /** |
|
237 | + * @access public |
|
238 | + * @return void |
|
239 | + * @throws \EE_Error |
|
240 | + * @throws \DomainException |
|
241 | + */ |
|
242 | 242 | public function event_list_iframe() { |
243 | - \EED_Events_Archive::$iframe = true; |
|
243 | + \EED_Events_Archive::$iframe = true; |
|
244 | 244 | $event_list_iframe = new EventsArchiveIframe( $this ); |
245 | 245 | $event_list_iframe->display(); |
246 | 246 | } |
247 | 247 | |
248 | 248 | |
249 | 249 | |
250 | - /** |
|
251 | - * @access public |
|
252 | - * @return string |
|
253 | - */ |
|
250 | + /** |
|
251 | + * @access public |
|
252 | + * @return string |
|
253 | + */ |
|
254 | 254 | public static function link_target() { |
255 | - return \EED_Events_Archive::$iframe ? ' target="_blank"' : ''; |
|
255 | + return \EED_Events_Archive::$iframe ? ' target="_blank"' : ''; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
4 | - exit( 'No direct script access allowed' ); |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | + exit('No direct script access allowed'); |
|
5 | 5 | } |
6 | 6 | /** |
7 | 7 | * |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function __construct() { |
54 | 54 | // deprecated functions |
55 | - espresso_load_required( 'EventEspresso\core\Factory', EE_CORE . 'Factory.php' ); |
|
55 | + espresso_load_required('EventEspresso\core\Factory', EE_CORE.'Factory.php'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -68,16 +68,16 @@ discard block |
||
68 | 68 | * @param EE_Response $response |
69 | 69 | * @return EE_Response |
70 | 70 | */ |
71 | - public function handle_request( EE_Request $request, EE_Response $response ) { |
|
71 | + public function handle_request(EE_Request $request, EE_Response $response) { |
|
72 | 72 | $this->request = $request; |
73 | 73 | $this->response = $response; |
74 | 74 | // info about how to load classes required by other classes |
75 | 75 | $this->dependency_map = $this->_load_dependency_map(); |
76 | 76 | // central repository for classes |
77 | 77 | $this->registry = $this->_load_registry(); |
78 | - do_action( 'EE_Load_Espresso_Core__handle_request__initialize_core_loading' ); |
|
78 | + do_action('EE_Load_Espresso_Core__handle_request__initialize_core_loading'); |
|
79 | 79 | // PSR4 Autoloaders |
80 | - $this->registry->load_core( 'EE_Psr4AutoloaderInit' ); |
|
80 | + $this->registry->load_core('EE_Psr4AutoloaderInit'); |
|
81 | 81 | // build DI container |
82 | 82 | $OpenCoffeeShop = new EventEspresso\core\services\container\OpenCoffeeShop(); |
83 | 83 | $OpenCoffeeShop->addRecipes(); |
@@ -87,20 +87,20 @@ discard block |
||
87 | 87 | 'CommandBusInterface', |
88 | 88 | array( |
89 | 89 | null, |
90 | - $this->registry->create( 'CapChecker' ) |
|
90 | + $this->registry->create('CapChecker') |
|
91 | 91 | ), |
92 | 92 | true |
93 | 93 | ); |
94 | 94 | // workarounds for PHP < 5.3 |
95 | 95 | $this->_load_class_tools(); |
96 | 96 | // load interfaces |
97 | - espresso_load_required( 'EEI_Payment_Method_Interfaces', EE_LIBRARIES . 'payment_methods' . DS . 'EEI_Payment_Method_Interfaces.php' ); |
|
97 | + espresso_load_required('EEI_Payment_Method_Interfaces', EE_LIBRARIES.'payment_methods'.DS.'EEI_Payment_Method_Interfaces.php'); |
|
98 | 98 | // deprecated functions |
99 | - espresso_load_required( 'EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php' ); |
|
99 | + espresso_load_required('EE_Deprecated', EE_CORE.'EE_Deprecated.core.php'); |
|
100 | 100 | // WP cron jobs |
101 | - $this->registry->load_core( 'Cron_Tasks' ); |
|
102 | - $this->registry->load_core( 'EE_Request_Handler' ); |
|
103 | - $this->registry->load_core( 'EE_System' ); |
|
101 | + $this->registry->load_core('Cron_Tasks'); |
|
102 | + $this->registry->load_core('EE_Request_Handler'); |
|
103 | + $this->registry->load_core('EE_System'); |
|
104 | 104 | |
105 | 105 | return $this->response; |
106 | 106 | } |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | * @throws \EE_Error |
131 | 131 | */ |
132 | 132 | public function dependency_map() { |
133 | - if ( ! $this->dependency_map instanceof EE_Dependency_Map ) { |
|
133 | + if ( ! $this->dependency_map instanceof EE_Dependency_Map) { |
|
134 | 134 | throw new EE_Error( |
135 | 135 | sprintf( |
136 | - __( 'Invalid EE_Dependency_Map: "%1$s"', 'event_espresso' ), |
|
137 | - print_r( $this->dependency_map, true ) |
|
136 | + __('Invalid EE_Dependency_Map: "%1$s"', 'event_espresso'), |
|
137 | + print_r($this->dependency_map, true) |
|
138 | 138 | ) |
139 | 139 | ); |
140 | 140 | } |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | * @throws \EE_Error |
149 | 149 | */ |
150 | 150 | public function registry() { |
151 | - if ( ! $this->registry instanceof EE_Registry ) { |
|
151 | + if ( ! $this->registry instanceof EE_Registry) { |
|
152 | 152 | throw new EE_Error( |
153 | 153 | sprintf( |
154 | - __( 'Invalid EE_Registry: "%1$s"', 'event_espresso' ), |
|
155 | - print_r( $this->registry, true ) |
|
154 | + __('Invalid EE_Registry: "%1$s"', 'event_espresso'), |
|
155 | + print_r($this->registry, true) |
|
156 | 156 | ) |
157 | 157 | ); |
158 | 158 | } |
@@ -168,15 +168,15 @@ discard block |
||
168 | 168 | * @return EE_Dependency_Map |
169 | 169 | */ |
170 | 170 | private function _load_dependency_map() { |
171 | - if ( ! is_readable( EE_CORE . 'EE_Dependency_Map.core.php' ) ) { |
|
171 | + if ( ! is_readable(EE_CORE.'EE_Dependency_Map.core.php')) { |
|
172 | 172 | EE_Error::add_error( |
173 | - __( 'The EE_Dependency_Map core class could not be loaded.', 'event_espresso' ), |
|
173 | + __('The EE_Dependency_Map core class could not be loaded.', 'event_espresso'), |
|
174 | 174 | __FILE__, __FUNCTION__, __LINE__ |
175 | 175 | ); |
176 | - wp_die( EE_Error::get_notices() ); |
|
176 | + wp_die(EE_Error::get_notices()); |
|
177 | 177 | } |
178 | - require_once( EE_CORE . 'EE_Dependency_Map.core.php' ); |
|
179 | - return EE_Dependency_Map::instance( $this->request, $this->response ); |
|
178 | + require_once(EE_CORE.'EE_Dependency_Map.core.php'); |
|
179 | + return EE_Dependency_Map::instance($this->request, $this->response); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | * @return EE_Registry |
189 | 189 | */ |
190 | 190 | private function _load_registry() { |
191 | - if ( ! is_readable( EE_CORE . 'EE_Registry.core.php' )) { |
|
191 | + if ( ! is_readable(EE_CORE.'EE_Registry.core.php')) { |
|
192 | 192 | EE_Error::add_error( |
193 | - __( 'The EE_Registry core class could not be loaded.', 'event_espresso' ), |
|
193 | + __('The EE_Registry core class could not be loaded.', 'event_espresso'), |
|
194 | 194 | __FILE__, __FUNCTION__, __LINE__ |
195 | 195 | ); |
196 | - wp_die( EE_Error::get_notices() ); |
|
196 | + wp_die(EE_Error::get_notices()); |
|
197 | 197 | } |
198 | - require_once( EE_CORE . 'EE_Registry.core.php' ); |
|
199 | - return EE_Registry::instance( $this->dependency_map ); |
|
198 | + require_once(EE_CORE.'EE_Registry.core.php'); |
|
199 | + return EE_Registry::instance($this->dependency_map); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -207,13 +207,13 @@ discard block |
||
207 | 207 | * @return void |
208 | 208 | */ |
209 | 209 | private function _load_class_tools() { |
210 | - if ( ! is_readable( EE_HELPERS . 'EEH_Class_Tools.helper.php' )) { |
|
210 | + if ( ! is_readable(EE_HELPERS.'EEH_Class_Tools.helper.php')) { |
|
211 | 211 | EE_Error::add_error( |
212 | - __( 'The EEH_Class_Tools helper could not be loaded.', 'event_espresso' ), |
|
212 | + __('The EEH_Class_Tools helper could not be loaded.', 'event_espresso'), |
|
213 | 213 | __FILE__, __FUNCTION__, __LINE__ |
214 | 214 | ); |
215 | 215 | } |
216 | - require_once( EE_HELPERS . 'EEH_Class_Tools.helper.php' ); |
|
216 | + require_once(EE_HELPERS.'EEH_Class_Tools.helper.php'); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | * @param \EE_Request $request |
228 | 228 | * @param \EE_Response $response |
229 | 229 | */ |
230 | - public function handle_response( EE_Request $request, EE_Response $response ) { |
|
230 | + public function handle_response(EE_Request $request, EE_Response $response) { |
|
231 | 231 | //\EEH_Debug_Tools::printr( __FUNCTION__, __CLASS__, __FILE__, __LINE__, 2 ); |
232 | 232 | //EEH_Debug_Tools::printr( $request, '$request', __FILE__, __LINE__ ); |
233 | 233 | //EEH_Debug_Tools::printr( $response, '$response', __FILE__, __LINE__ ); |
234 | 234 | //die(); |
235 | - if ( $response->plugin_deactivated() ) { |
|
236 | - espresso_deactivate_plugin( EE_PLUGIN_BASENAME ); |
|
235 | + if ($response->plugin_deactivated()) { |
|
236 | + espresso_deactivate_plugin(EE_PLUGIN_BASENAME); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 |
@@ -102,8 +102,8 @@ |
||
102 | 102 | // use_captcha ? |
103 | 103 | if ( |
104 | 104 | EE_Registry::instance()->CFG->registration->use_captcha |
105 | - && EE_Registry::instance()->REQ->get( 'step', '' ) !== '' |
|
106 | - && ! ( |
|
105 | + && EE_Registry::instance()->REQ->get( 'step', '' ) !== '' |
|
106 | + && ! ( |
|
107 | 107 | EE_Registry::instance()->REQ->get( 'step', '' ) === 'payment_options' |
108 | 108 | && (boolean) EE_Registry::instance()->REQ->get( 'revisit', false ) === true |
109 | 109 | ) |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return EED_Recaptcha |
44 | 44 | */ |
45 | 45 | public static function instance() { |
46 | - return parent::get_instance( __CLASS__ ); |
|
46 | + return parent::get_instance(__CLASS__); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -59,32 +59,32 @@ discard block |
||
59 | 59 | if ( |
60 | 60 | EE_Registry::instance()->CFG->registration->use_captcha |
61 | 61 | && ! ( |
62 | - EE_Registry::instance()->REQ->get( 'step', '' ) === 'payment_options' |
|
63 | - && (boolean) EE_Registry::instance()->REQ->get( 'revisit', false ) === true |
|
62 | + EE_Registry::instance()->REQ->get('step', '') === 'payment_options' |
|
63 | + && (boolean) EE_Registry::instance()->REQ->get('revisit', false) === true |
|
64 | 64 | ) |
65 | 65 | ) { |
66 | 66 | EED_Recaptcha::set_definitions(); |
67 | 67 | EED_Recaptcha::enqueue_styles_and_scripts(); |
68 | - add_action( 'wp', array( 'EED_Recaptcha', 'set_late_hooks' ), 1, 0 ); |
|
68 | + add_action('wp', array('EED_Recaptcha', 'set_late_hooks'), 1, 0); |
|
69 | 69 | add_action( |
70 | 70 | 'AHEE__before_spco_whats_next_buttons', |
71 | - array( 'EED_Recaptcha', 'display_recaptcha' ), 10, 0 |
|
71 | + array('EED_Recaptcha', 'display_recaptcha'), 10, 0 |
|
72 | 72 | ); |
73 | 73 | add_filter( |
74 | 74 | 'FHEE__EED_Single_Page_Checkout__init___continue_reg', |
75 | - array( 'EED_Recaptcha', 'not_a_robot' ), 10 |
|
75 | + array('EED_Recaptcha', 'not_a_robot'), 10 |
|
76 | 76 | ); |
77 | 77 | add_filter( |
78 | 78 | 'FHEE__EE_SPCO_Reg_Step__set_completed___completed', |
79 | - array( 'EED_Recaptcha', 'not_a_robot' ), 10 |
|
79 | + array('EED_Recaptcha', 'not_a_robot'), 10 |
|
80 | 80 | ); |
81 | 81 | add_filter( |
82 | 82 | 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', |
83 | - array( 'EED_Recaptcha', 'recaptcha_response' ), 10, 1 |
|
83 | + array('EED_Recaptcha', 'recaptcha_response'), 10, 1 |
|
84 | 84 | ); |
85 | 85 | add_filter( |
86 | 86 | 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', |
87 | - array( 'EED_Recaptcha', 'bypass_recaptcha_for_spco_load_payment_method' ), 10, 1 |
|
87 | + array('EED_Recaptcha', 'bypass_recaptcha_for_spco_load_payment_method'), 10, 1 |
|
88 | 88 | ); |
89 | 89 | } |
90 | 90 | } |
@@ -102,20 +102,20 @@ discard block |
||
102 | 102 | // use_captcha ? |
103 | 103 | if ( |
104 | 104 | EE_Registry::instance()->CFG->registration->use_captcha |
105 | - && EE_Registry::instance()->REQ->get( 'step', '' ) !== '' |
|
105 | + && EE_Registry::instance()->REQ->get('step', '') !== '' |
|
106 | 106 | && ! ( |
107 | - EE_Registry::instance()->REQ->get( 'step', '' ) === 'payment_options' |
|
108 | - && (boolean) EE_Registry::instance()->REQ->get( 'revisit', false ) === true |
|
107 | + EE_Registry::instance()->REQ->get('step', '') === 'payment_options' |
|
108 | + && (boolean) EE_Registry::instance()->REQ->get('revisit', false) === true |
|
109 | 109 | ) |
110 | 110 | ) { |
111 | 111 | EED_Recaptcha::enqueue_styles_and_scripts(); |
112 | - add_filter( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', array( 'EED_Recaptcha', 'not_a_robot' ), 10 ); |
|
113 | - add_filter( 'FHEE__EE_SPCO_Reg_Step__set_completed___completed', array( 'EED_Recaptcha', 'not_a_robot' ), 10 ); |
|
114 | - add_filter( 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', array( 'EED_Recaptcha', 'recaptcha_response' ), 10, 1 ); |
|
112 | + add_filter('FHEE__EED_Single_Page_Checkout__init___continue_reg', array('EED_Recaptcha', 'not_a_robot'), 10); |
|
113 | + add_filter('FHEE__EE_SPCO_Reg_Step__set_completed___completed', array('EED_Recaptcha', 'not_a_robot'), 10); |
|
114 | + add_filter('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', array('EED_Recaptcha', 'recaptcha_response'), 10, 1); |
|
115 | 115 | } |
116 | 116 | // admin settings |
117 | - add_action( 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', array( 'EED_Recaptcha', 'admin_settings' ), 10, 1 ); |
|
118 | - add_filter( 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', array( 'EED_Recaptcha', 'update_admin_settings' ), 10, 1 ); |
|
117 | + add_action('AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', array('EED_Recaptcha', 'admin_settings'), 10, 1); |
|
118 | + add_filter('FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', array('EED_Recaptcha', 'update_admin_settings'), 10, 1); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | * @return void |
128 | 128 | */ |
129 | 129 | public static function set_definitions() { |
130 | - if ( is_user_logged_in() ) { |
|
130 | + if (is_user_logged_in()) { |
|
131 | 131 | EED_Recaptcha::$_not_a_robot = true; |
132 | 132 | } |
133 | - define( 'RECAPTCHA_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS ); |
|
134 | - define( 'RECAPTCHA_BASE_URL', plugin_dir_url( __FILE__ )); |
|
133 | + define('RECAPTCHA_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS); |
|
134 | + define('RECAPTCHA_BASE_URL', plugin_dir_url(__FILE__)); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public static function set_late_hooks() { |
146 | 146 | add_filter( |
147 | 147 | 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', |
148 | - array( 'EED_Recaptcha', 'not_a_robot' ) |
|
148 | + array('EED_Recaptcha', 'not_a_robot') |
|
149 | 149 | ); |
150 | 150 | } |
151 | 151 | |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | * @return void |
159 | 159 | */ |
160 | 160 | public static function enqueue_styles_and_scripts() { |
161 | - wp_register_script( 'espresso_recaptcha', RECAPTCHA_BASE_URL . 'scripts' . DS . 'espresso_recaptcha.js', array( 'single_page_checkout' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
162 | - wp_register_script( 'google_recaptcha', 'https://www.google.com/recaptcha/api.js?hl=' . EE_Registry::instance()->CFG->registration->recaptcha_language, array( 'espresso_recaptcha' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
163 | - EE_Registry::$i18n_js_strings['no_SPCO_error'] = __( 'It appears the Single Page Checkout javascript was not loaded properly! Please refresh the page and try again or contact support.', 'event_espresso' ); |
|
164 | - EE_Registry::$i18n_js_strings['no_recaptcha_error'] = __( 'There appears to be a problem with the reCAPTCHA configuration! Please check the admin settings or contact support.', 'event_espresso' ); |
|
165 | - EE_Registry::$i18n_js_strings['recaptcha_fail'] = __( 'Please complete the anti-spam test before proceeding.', 'event_espresso' ); |
|
161 | + wp_register_script('espresso_recaptcha', RECAPTCHA_BASE_URL.'scripts'.DS.'espresso_recaptcha.js', array('single_page_checkout'), EVENT_ESPRESSO_VERSION, TRUE); |
|
162 | + wp_register_script('google_recaptcha', 'https://www.google.com/recaptcha/api.js?hl='.EE_Registry::instance()->CFG->registration->recaptcha_language, array('espresso_recaptcha'), EVENT_ESPRESSO_VERSION, TRUE); |
|
163 | + EE_Registry::$i18n_js_strings['no_SPCO_error'] = __('It appears the Single Page Checkout javascript was not loaded properly! Please refresh the page and try again or contact support.', 'event_espresso'); |
|
164 | + EE_Registry::$i18n_js_strings['no_recaptcha_error'] = __('There appears to be a problem with the reCAPTCHA configuration! Please check the admin settings or contact support.', 'event_espresso'); |
|
165 | + EE_Registry::$i18n_js_strings['recaptcha_fail'] = __('Please complete the anti-spam test before proceeding.', 'event_espresso'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @access public |
174 | 174 | * @param \WP $WP |
175 | 175 | */ |
176 | - public function run( $WP ) { |
|
176 | + public function run($WP) { |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
@@ -183,8 +183,7 @@ discard block |
||
183 | 183 | * @return boolean |
184 | 184 | */ |
185 | 185 | public static function not_a_robot() { |
186 | - $not_a_robot = is_bool( EED_Recaptcha::$_not_a_robot ) ? EED_Recaptcha::$_not_a_robot : |
|
187 | - EED_Recaptcha::recaptcha_passed(); |
|
186 | + $not_a_robot = is_bool(EED_Recaptcha::$_not_a_robot) ? EED_Recaptcha::$_not_a_robot : EED_Recaptcha::recaptcha_passed(); |
|
188 | 187 | return $not_a_robot; |
189 | 188 | } |
190 | 189 | |
@@ -200,22 +199,22 @@ discard block |
||
200 | 199 | */ |
201 | 200 | public static function display_recaptcha() { |
202 | 201 | // logged in means you have already passed a turing test of sorts |
203 | - if ( is_user_logged_in() ) { |
|
202 | + if (is_user_logged_in()) { |
|
204 | 203 | return; |
205 | 204 | } |
206 | 205 | // don't display if not using recaptcha or user is logged in |
207 | - if ( EE_Registry::instance()->CFG->registration->use_captcha ) { |
|
206 | + if (EE_Registry::instance()->CFG->registration->use_captcha) { |
|
208 | 207 | // only display if they have NOT passed the test yet |
209 | - if ( ! EED_Recaptcha::$_not_a_robot ) { |
|
208 | + if ( ! EED_Recaptcha::$_not_a_robot) { |
|
210 | 209 | EEH_Template::display_template( |
211 | - RECAPTCHA_BASE_PATH . DS . 'templates' . DS . 'recaptcha.template.php', |
|
210 | + RECAPTCHA_BASE_PATH.DS.'templates'.DS.'recaptcha.template.php', |
|
212 | 211 | array( |
213 | 212 | 'recaptcha_publickey' => EE_Registry::instance()->CFG->registration->recaptcha_publickey, |
214 | 213 | 'recaptcha_theme' => EE_Registry::instance()->CFG->registration->recaptcha_theme, |
215 | 214 | 'recaptcha_type' => EE_Registry::instance()->CFG->registration->recaptcha_type |
216 | 215 | ) |
217 | 216 | ); |
218 | - wp_enqueue_script( 'google_recaptcha' ); |
|
217 | + wp_enqueue_script('google_recaptcha'); |
|
219 | 218 | } |
220 | 219 | } |
221 | 220 | } |
@@ -246,17 +245,17 @@ discard block |
||
246 | 245 | */ |
247 | 246 | public static function recaptcha_passed() { |
248 | 247 | // logged in means you have already passed a turing test of sorts |
249 | - if ( is_user_logged_in() || EED_Recaptcha::_bypass_recaptcha() ) { |
|
248 | + if (is_user_logged_in() || EED_Recaptcha::_bypass_recaptcha()) { |
|
250 | 249 | return TRUE; |
251 | 250 | } |
252 | 251 | // was test already passed? |
253 | - $recaptcha_passed = EE_Registry::instance()->SSN->get_session_data( 'recaptcha_passed' ); |
|
254 | - $recaptcha_passed = filter_var( $recaptcha_passed, FILTER_VALIDATE_BOOLEAN ); |
|
252 | + $recaptcha_passed = EE_Registry::instance()->SSN->get_session_data('recaptcha_passed'); |
|
253 | + $recaptcha_passed = filter_var($recaptcha_passed, FILTER_VALIDATE_BOOLEAN); |
|
255 | 254 | // verify recaptcha |
256 | 255 | EED_Recaptcha::_get_recaptcha_response(); |
257 | - if ( ! $recaptcha_passed && EED_Recaptcha::$_recaptcha_response ) { |
|
256 | + if ( ! $recaptcha_passed && EED_Recaptcha::$_recaptcha_response) { |
|
258 | 257 | $recaptcha_passed = EED_Recaptcha::_process_recaptcha_response(); |
259 | - EE_Registry::instance()->SSN->set_session_data( array( 'recaptcha_passed' => $recaptcha_passed )); |
|
258 | + EE_Registry::instance()->SSN->set_session_data(array('recaptcha_passed' => $recaptcha_passed)); |
|
260 | 259 | EE_Registry::instance()->SSN->update(); |
261 | 260 | } |
262 | 261 | EED_Recaptcha::$_not_a_robot = $recaptcha_passed; |
@@ -272,8 +271,8 @@ discard block |
||
272 | 271 | * @param array $recaptcha_response |
273 | 272 | * @return boolean |
274 | 273 | */ |
275 | - public static function recaptcha_response( $recaptcha_response = array() ) { |
|
276 | - if ( EED_Recaptcha::_bypass_recaptcha() ) { |
|
274 | + public static function recaptcha_response($recaptcha_response = array()) { |
|
275 | + if (EED_Recaptcha::_bypass_recaptcha()) { |
|
277 | 276 | $recaptcha_response['bypass_recaptcha'] = TRUE; |
278 | 277 | $recaptcha_response['recaptcha_passed'] = TRUE; |
279 | 278 | } else { |
@@ -293,16 +292,16 @@ discard block |
||
293 | 292 | */ |
294 | 293 | private static function _bypass_recaptcha() { |
295 | 294 | // an array of key value pairs that must match exactly with the incoming request, in order to bypass recaptcha for the current request ONLY |
296 | - $bypass_request_params_array = apply_filters( 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array() ); |
|
295 | + $bypass_request_params_array = apply_filters('FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array()); |
|
297 | 296 | // does $bypass_request_params_array have any values ? |
298 | - if ( empty( $bypass_request_params_array )) { |
|
297 | + if (empty($bypass_request_params_array)) { |
|
299 | 298 | return FALSE; |
300 | 299 | } |
301 | 300 | // initially set bypass to TRUE |
302 | 301 | $bypass_recaptcha = TRUE; |
303 | - foreach ( $bypass_request_params_array as $key => $value ) { |
|
302 | + foreach ($bypass_request_params_array as $key => $value) { |
|
304 | 303 | // if $key is not found or value doesn't match exactly, then toggle bypass to FALSE, otherwise carry over it's value. This way, one missed setting results in no bypass |
305 | - $bypass_recaptcha = isset( $_REQUEST[ $key ] ) && $_REQUEST[ $key ] === $value ? $bypass_recaptcha : FALSE; |
|
304 | + $bypass_recaptcha = isset($_REQUEST[$key]) && $_REQUEST[$key] === $value ? $bypass_recaptcha : FALSE; |
|
306 | 305 | } |
307 | 306 | return $bypass_recaptcha; |
308 | 307 | } |
@@ -317,7 +316,7 @@ discard block |
||
317 | 316 | * @return boolean |
318 | 317 | */ |
319 | 318 | private static function _get_recaptcha_response() { |
320 | - EED_Recaptcha::$_recaptcha_response = EE_Registry::instance()->REQ->get( 'g-recaptcha-response', false ); |
|
319 | + EED_Recaptcha::$_recaptcha_response = EE_Registry::instance()->REQ->get('g-recaptcha-response', false); |
|
321 | 320 | } |
322 | 321 | |
323 | 322 | |
@@ -331,26 +330,26 @@ discard block |
||
331 | 330 | */ |
332 | 331 | private static function _process_recaptcha_response() { |
333 | 332 | // verify library is loaded |
334 | - if ( ! class_exists( '\\ReCaptcha\\ReCaptcha' )) { |
|
335 | - require_once( RECAPTCHA_BASE_PATH . DS . 'autoload.php' ); |
|
333 | + if ( ! class_exists('\\ReCaptcha\\ReCaptcha')) { |
|
334 | + require_once(RECAPTCHA_BASE_PATH.DS.'autoload.php'); |
|
336 | 335 | } |
337 | 336 | // The response from reCAPTCHA |
338 | 337 | EED_Recaptcha::_get_recaptcha_response(); |
339 | 338 | $recaptcha_response = EED_Recaptcha::$_recaptcha_response; |
340 | 339 | // Was there a reCAPTCHA response? |
341 | - if ( $recaptcha_response ) { |
|
340 | + if ($recaptcha_response) { |
|
342 | 341 | // if allow_url_fopen is Off, then set a different request method |
343 | - $request_method = ! ini_get( 'allow_url_fopen' ) ? new \ReCaptcha\RequestMethod\SocketPost() : null; |
|
342 | + $request_method = ! ini_get('allow_url_fopen') ? new \ReCaptcha\RequestMethod\SocketPost() : null; |
|
344 | 343 | $recaptcha = new \ReCaptcha\ReCaptcha( |
345 | 344 | EE_Registry::instance()->CFG->registration->recaptcha_privatekey, |
346 | 345 | $request_method |
347 | 346 | ); |
348 | 347 | $recaptcha_response = $recaptcha->verify( |
349 | 348 | EED_Recaptcha::$_recaptcha_response, |
350 | - $_SERVER[ 'REMOTE_ADDR' ] |
|
349 | + $_SERVER['REMOTE_ADDR'] |
|
351 | 350 | ); |
352 | 351 | } |
353 | - if ( $recaptcha_response instanceof \ReCaptcha\Response && $recaptcha_response->isSuccess() ) { |
|
352 | + if ($recaptcha_response instanceof \ReCaptcha\Response && $recaptcha_response->isSuccess()) { |
|
354 | 353 | return TRUE; |
355 | 354 | } |
356 | 355 | // sorry... it appears you can't don't know what soup or hamburgers are !!! |
@@ -394,12 +393,12 @@ discard block |
||
394 | 393 | 'subsections' => apply_filters( |
395 | 394 | 'FHEE__EED_Recaptcha___recaptcha_settings_form__form_subsections', |
396 | 395 | array( |
397 | - 'main_settings_hdr' => new EE_Form_Section_HTML( EEH_HTML::h2( __( 'reCAPTCHA Anti-spam Settings', 'event_espresso' ) . EEH_Template::get_help_tab_link( 'recaptcha_info' ))), |
|
396 | + 'main_settings_hdr' => new EE_Form_Section_HTML(EEH_HTML::h2(__('reCAPTCHA Anti-spam Settings', 'event_espresso').EEH_Template::get_help_tab_link('recaptcha_info'))), |
|
398 | 397 | 'main_settings' => EED_Recaptcha::_recaptcha_main_settings(), |
399 | - 'appearance_settings_hdr' => new EE_Form_Section_HTML( EEH_HTML::h2( __( 'reCAPTCHA Appearance', 'event_espresso' ) )), |
|
398 | + 'appearance_settings_hdr' => new EE_Form_Section_HTML(EEH_HTML::h2(__('reCAPTCHA Appearance', 'event_espresso'))), |
|
400 | 399 | 'appearance_settings' => EED_Recaptcha::_recaptcha_appearance_settings(), |
401 | 400 | // 'recaptcha_example' => new EE_Form_Section_HTML( EED_Recaptcha::display_recaptcha() ), |
402 | - 'required_fields_note' => new EE_Form_Section_HTML( EEH_HTML::p( __( 'All fields marked with a * are required fields', 'event_espresso' ), '', 'grey-text' )) |
|
401 | + 'required_fields_note' => new EE_Form_Section_HTML(EEH_HTML::p(__('All fields marked with a * are required fields', 'event_espresso'), '', 'grey-text')) |
|
403 | 402 | ) |
404 | 403 | ) |
405 | 404 | ) |
@@ -426,28 +425,28 @@ discard block |
||
426 | 425 | array( |
427 | 426 | 'use_captcha' => new EE_Yes_No_Input( |
428 | 427 | array( |
429 | - 'html_label_text' => __( 'Use reCAPTCHA', 'event_espresso' ), |
|
428 | + 'html_label_text' => __('Use reCAPTCHA', 'event_espresso'), |
|
430 | 429 | 'html_help_text' => sprintf( |
431 | - __( 'reCAPTCHA is a free service that protects your website from spam and abuse. It employs advanced risk analysis technology to separate humans from abusive actors. Sign up %1$shere%2$s to receive your Public and Private keys.', 'event_espresso' ), |
|
430 | + __('reCAPTCHA is a free service that protects your website from spam and abuse. It employs advanced risk analysis technology to separate humans from abusive actors. Sign up %1$shere%2$s to receive your Public and Private keys.', 'event_espresso'), |
|
432 | 431 | '<a href="https://www.google.com/recaptcha/intro/index.html">', |
433 | 432 | '</a>' |
434 | 433 | ), |
435 | - 'default' => isset( EE_Registry::instance()->CFG->registration->use_captcha ) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE, |
|
434 | + 'default' => isset(EE_Registry::instance()->CFG->registration->use_captcha) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE, |
|
436 | 435 | 'display_html_label_text' => FALSE |
437 | 436 | ) |
438 | 437 | ), |
439 | 438 | 'recaptcha_publickey' => new EE_Text_Input( |
440 | 439 | array( |
441 | - 'html_label_text' => __( 'Site Key', 'event_espresso' ), |
|
442 | - 'html_help_text' => __( 'The site key is used to display the widget on your site.', 'event_espresso' ), |
|
443 | - 'default' => isset( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) : '' |
|
440 | + 'html_label_text' => __('Site Key', 'event_espresso'), |
|
441 | + 'html_help_text' => __('The site key is used to display the widget on your site.', 'event_espresso'), |
|
442 | + 'default' => isset(EE_Registry::instance()->CFG->registration->recaptcha_publickey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_publickey) : '' |
|
444 | 443 | ) |
445 | 444 | ), |
446 | 445 | 'recaptcha_privatekey' => new EE_Text_Input( |
447 | 446 | array( |
448 | - 'html_label_text' => __( 'Secret Key', 'event_espresso' ), |
|
449 | - 'html_help_text' => __( 'The secret key authorizes communication between your application backend and the reCAPTCHA server to verify the user\'s response. The secret key needs to be kept safe for security purposes.', 'event_espresso' ), |
|
450 | - 'default' => isset( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) : '' |
|
447 | + 'html_label_text' => __('Secret Key', 'event_espresso'), |
|
448 | + 'html_help_text' => __('The secret key authorizes communication between your application backend and the reCAPTCHA server to verify the user\'s response. The secret key needs to be kept safe for security purposes.', 'event_espresso'), |
|
449 | + 'default' => isset(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) : '' |
|
451 | 450 | ) |
452 | 451 | ) |
453 | 452 | ) |
@@ -479,81 +478,81 @@ discard block |
||
479 | 478 | array( |
480 | 479 | 'recaptcha_theme' => new EE_Radio_Button_Input( |
481 | 480 | array( |
482 | - 'light' => __( 'Light', 'event_espresso' ), |
|
483 | - 'dark' => __( 'Dark', 'event_espresso' ) |
|
481 | + 'light' => __('Light', 'event_espresso'), |
|
482 | + 'dark' => __('Dark', 'event_espresso') |
|
484 | 483 | ), |
485 | 484 | array( |
486 | - 'html_label_text' => __( 'Theme', 'event_espresso' ), |
|
487 | - 'html_help_text' => __( 'The color theme of the widget.', 'event_espresso' ), |
|
488 | - 'default' => isset( EE_Registry::instance()->CFG->registration->recaptcha_theme ) ? EE_Registry::instance()->CFG->registration->recaptcha_theme : 'light', |
|
485 | + 'html_label_text' => __('Theme', 'event_espresso'), |
|
486 | + 'html_help_text' => __('The color theme of the widget.', 'event_espresso'), |
|
487 | + 'default' => isset(EE_Registry::instance()->CFG->registration->recaptcha_theme) ? EE_Registry::instance()->CFG->registration->recaptcha_theme : 'light', |
|
489 | 488 | 'display_html_label_text' => FALSE |
490 | 489 | ) |
491 | 490 | ), |
492 | 491 | 'recaptcha_type' => new EE_Radio_Button_Input( |
493 | 492 | array( |
494 | - 'image' => __( 'Image', 'event_espresso' ), |
|
495 | - 'audio' => __( 'Audio', 'event_espresso' ) |
|
493 | + 'image' => __('Image', 'event_espresso'), |
|
494 | + 'audio' => __('Audio', 'event_espresso') |
|
496 | 495 | ), |
497 | 496 | array( |
498 | - 'html_label_text' => __( 'Type', 'event_espresso' ), |
|
499 | - 'html_help_text' => __( 'The type of CAPTCHA to serve.', 'event_espresso' ), |
|
500 | - 'default' => isset( EE_Registry::instance()->CFG->registration->recaptcha_type ) ? EE_Registry::instance()->CFG->registration->recaptcha_type : 'image', |
|
497 | + 'html_label_text' => __('Type', 'event_espresso'), |
|
498 | + 'html_help_text' => __('The type of CAPTCHA to serve.', 'event_espresso'), |
|
499 | + 'default' => isset(EE_Registry::instance()->CFG->registration->recaptcha_type) ? EE_Registry::instance()->CFG->registration->recaptcha_type : 'image', |
|
501 | 500 | 'display_html_label_text' =>FALSE |
502 | 501 | ) |
503 | 502 | ), |
504 | 503 | 'recaptcha_language' => new EE_Select_Input( |
505 | 504 | array( |
506 | - 'ar' => __( 'Arabic', 'event_espresso' ), |
|
507 | - 'bg' => __( 'Bulgarian', 'event_espresso' ), |
|
508 | - 'ca' => __( 'Catalan', 'event_espresso' ), |
|
509 | - 'zh-CN' => __( 'Chinese (Simplified)', 'event_espresso' ), |
|
510 | - 'zh-TW' => __( 'Chinese (Traditional) ', 'event_espresso' ), |
|
511 | - 'hr' => __( 'Croatian', 'event_espresso' ), |
|
512 | - 'cs' => __( 'Czech', 'event_espresso' ), |
|
513 | - 'da' => __( 'Danish', 'event_espresso' ), |
|
514 | - 'nl' => __( 'Dutch', 'event_espresso' ), |
|
515 | - 'en-GB' => __( 'English (UK)', 'event_espresso' ), |
|
516 | - 'en' => __( 'English (US)', 'event_espresso' ), |
|
517 | - 'fil' => __( 'Filipino', 'event_espresso' ), |
|
518 | - 'fi' => __( 'Finnish', 'event_espresso' ), |
|
519 | - 'fr' => __( 'French', 'event_espresso' ), |
|
520 | - 'fr-CA' => __( 'French (Canadian)', 'event_espresso' ), |
|
521 | - 'de' => __( 'German', 'event_espresso' ), |
|
522 | - 'de-AT' => __( 'German (Austria)', 'event_espresso' ), |
|
523 | - 'de-CH' => __( 'German (Switzerland)', 'event_espresso' ), |
|
524 | - 'el' => __( 'Greek', 'event_espresso' ), |
|
525 | - 'iw' => __( 'Hebrew', 'event_espresso' ), |
|
526 | - 'hi' => __( 'Hindi', 'event_espresso' ), |
|
527 | - 'hu' => __( 'Hungarian', 'event_espresso' ), |
|
528 | - 'id' => __( 'Indonesian', 'event_espresso' ), |
|
529 | - 'it' => __( 'Italian', 'event_espresso' ), |
|
530 | - 'ja' => __( 'Japanese', 'event_espresso' ), |
|
531 | - 'ko' => __( 'Korean', 'event_espresso' ), |
|
532 | - 'lv' => __( 'Latvian', 'event_espresso' ), |
|
533 | - 'lt' => __( 'Lithuanian', 'event_espresso' ), |
|
534 | - 'no' => __( 'Norwegian', 'event_espresso' ), |
|
535 | - 'fa' => __( 'Persian', 'event_espresso' ), |
|
536 | - 'pl' => __( 'Polish', 'event_espresso' ), |
|
537 | - 'pt' => __( 'Portuguese', 'event_espresso' ), |
|
538 | - 'pt-BR' => __( 'Portuguese (Brazil)', 'event_espresso' ), |
|
539 | - 'pt-PT' => __( 'Portuguese (Portugal)', 'event_espresso' ), |
|
540 | - 'ro' => __( 'Romanian', 'event_espresso' ), |
|
541 | - 'ru' => __( 'Russian', 'event_espresso' ), |
|
542 | - 'sr' => __( 'Serbian', 'event_espresso' ), |
|
543 | - 'sk' => __( 'Slovak', 'event_espresso' ), |
|
544 | - 'sl' => __( 'Slovenian', 'event_espresso' ), |
|
545 | - 'es' => __( 'Spanish', 'event_espresso' ), |
|
546 | - 'es-419' => __( 'Spanish (Latin America)', 'event_espresso' ), |
|
547 | - 'sv' => __( 'Swedish', 'event_espresso' ), |
|
548 | - 'th' => __( 'Thai', 'event_espresso' ), |
|
549 | - 'tr' => __( 'Turkish', 'event_espresso' ), |
|
550 | - 'uk' => __( 'Ukrainian', 'event_espresso' ), |
|
551 | - 'vi' => __( 'Vietnamese', 'event_espresso') |
|
505 | + 'ar' => __('Arabic', 'event_espresso'), |
|
506 | + 'bg' => __('Bulgarian', 'event_espresso'), |
|
507 | + 'ca' => __('Catalan', 'event_espresso'), |
|
508 | + 'zh-CN' => __('Chinese (Simplified)', 'event_espresso'), |
|
509 | + 'zh-TW' => __('Chinese (Traditional) ', 'event_espresso'), |
|
510 | + 'hr' => __('Croatian', 'event_espresso'), |
|
511 | + 'cs' => __('Czech', 'event_espresso'), |
|
512 | + 'da' => __('Danish', 'event_espresso'), |
|
513 | + 'nl' => __('Dutch', 'event_espresso'), |
|
514 | + 'en-GB' => __('English (UK)', 'event_espresso'), |
|
515 | + 'en' => __('English (US)', 'event_espresso'), |
|
516 | + 'fil' => __('Filipino', 'event_espresso'), |
|
517 | + 'fi' => __('Finnish', 'event_espresso'), |
|
518 | + 'fr' => __('French', 'event_espresso'), |
|
519 | + 'fr-CA' => __('French (Canadian)', 'event_espresso'), |
|
520 | + 'de' => __('German', 'event_espresso'), |
|
521 | + 'de-AT' => __('German (Austria)', 'event_espresso'), |
|
522 | + 'de-CH' => __('German (Switzerland)', 'event_espresso'), |
|
523 | + 'el' => __('Greek', 'event_espresso'), |
|
524 | + 'iw' => __('Hebrew', 'event_espresso'), |
|
525 | + 'hi' => __('Hindi', 'event_espresso'), |
|
526 | + 'hu' => __('Hungarian', 'event_espresso'), |
|
527 | + 'id' => __('Indonesian', 'event_espresso'), |
|
528 | + 'it' => __('Italian', 'event_espresso'), |
|
529 | + 'ja' => __('Japanese', 'event_espresso'), |
|
530 | + 'ko' => __('Korean', 'event_espresso'), |
|
531 | + 'lv' => __('Latvian', 'event_espresso'), |
|
532 | + 'lt' => __('Lithuanian', 'event_espresso'), |
|
533 | + 'no' => __('Norwegian', 'event_espresso'), |
|
534 | + 'fa' => __('Persian', 'event_espresso'), |
|
535 | + 'pl' => __('Polish', 'event_espresso'), |
|
536 | + 'pt' => __('Portuguese', 'event_espresso'), |
|
537 | + 'pt-BR' => __('Portuguese (Brazil)', 'event_espresso'), |
|
538 | + 'pt-PT' => __('Portuguese (Portugal)', 'event_espresso'), |
|
539 | + 'ro' => __('Romanian', 'event_espresso'), |
|
540 | + 'ru' => __('Russian', 'event_espresso'), |
|
541 | + 'sr' => __('Serbian', 'event_espresso'), |
|
542 | + 'sk' => __('Slovak', 'event_espresso'), |
|
543 | + 'sl' => __('Slovenian', 'event_espresso'), |
|
544 | + 'es' => __('Spanish', 'event_espresso'), |
|
545 | + 'es-419' => __('Spanish (Latin America)', 'event_espresso'), |
|
546 | + 'sv' => __('Swedish', 'event_espresso'), |
|
547 | + 'th' => __('Thai', 'event_espresso'), |
|
548 | + 'tr' => __('Turkish', 'event_espresso'), |
|
549 | + 'uk' => __('Ukrainian', 'event_espresso'), |
|
550 | + 'vi' => __('Vietnamese', 'event_espresso') |
|
552 | 551 | ), |
553 | 552 | array( |
554 | - 'html_label_text' => __( 'Language', 'event_espresso' ), |
|
555 | - 'html_help_text' => __( 'Forces the widget to render in a specific language.', 'event_espresso' ), |
|
556 | - 'default' => isset( EE_Registry::instance()->CFG->registration->recaptcha_language ) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en' |
|
553 | + 'html_label_text' => __('Language', 'event_espresso'), |
|
554 | + 'html_help_text' => __('Forces the widget to render in a specific language.', 'event_espresso'), |
|
555 | + 'default' => isset(EE_Registry::instance()->CFG->registration->recaptcha_language) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en' |
|
557 | 556 | ) |
558 | 557 | ) |
559 | 558 | ) |
@@ -601,25 +600,25 @@ discard block |
||
601 | 600 | * @param EE_Registration_Config $EE_Registration_Config |
602 | 601 | * @return array |
603 | 602 | */ |
604 | - public static function update_admin_settings( EE_Registration_Config $EE_Registration_Config ) { |
|
603 | + public static function update_admin_settings(EE_Registration_Config $EE_Registration_Config) { |
|
605 | 604 | try { |
606 | 605 | $recaptcha_settings_form = EED_Recaptcha::_recaptcha_settings_form(); |
607 | 606 | // if not displaying a form, then check for form submission |
608 | - if ( $recaptcha_settings_form->was_submitted() ) { |
|
607 | + if ($recaptcha_settings_form->was_submitted()) { |
|
609 | 608 | // capture form data |
610 | 609 | $recaptcha_settings_form->receive_form_submission(); |
611 | 610 | // validate form data |
612 | - if ( $recaptcha_settings_form->is_valid() ) { |
|
611 | + if ($recaptcha_settings_form->is_valid()) { |
|
613 | 612 | // grab validated data from form |
614 | 613 | $valid_data = $recaptcha_settings_form->valid_data(); |
615 | 614 | // user proofing recaptcha: If Use reCAPTCHA is set to yes but we dont' have site or secret keys then set Use reCAPTCHA to FALSE and give error message. |
616 | 615 | if ( |
617 | - apply_filters( 'FHEE__Extend_Registration_Form_Admin_Page__check_for_recaptcha_keys', TRUE, $EE_Registration_Config ) |
|
616 | + apply_filters('FHEE__Extend_Registration_Form_Admin_Page__check_for_recaptcha_keys', TRUE, $EE_Registration_Config) |
|
618 | 617 | && $valid_data['main_settings']['use_captcha'] |
619 | - && ( ! $EE_Registration_Config->use_captcha && ( empty( $valid_data['main_settings']['recaptcha_publickey'] ) || empty( $valid_data['main_settings']['recaptcha_privatekey'] ))) |
|
618 | + && ( ! $EE_Registration_Config->use_captcha && (empty($valid_data['main_settings']['recaptcha_publickey']) || empty($valid_data['main_settings']['recaptcha_privatekey']))) |
|
620 | 619 | ) { |
621 | 620 | $valid_data['main_settings']['use_captcha'] = FALSE; |
622 | - EE_Error::add_error( __('The use reCAPTCHA setting has been reset to "no". In order to enable the reCAPTCHA service, you must enter a Site Key and Secret Key.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
621 | + EE_Error::add_error(__('The use reCAPTCHA setting has been reset to "no". In order to enable the reCAPTCHA service, you must enter a Site Key and Secret Key.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
623 | 622 | } |
624 | 623 | $EE_Registration_Config->use_captcha = $valid_data['main_settings']['use_captcha']; |
625 | 624 | $EE_Registration_Config->recaptcha_publickey = $valid_data['main_settings']['recaptcha_publickey']; |
@@ -628,12 +627,12 @@ discard block |
||
628 | 627 | $EE_Registration_Config->recaptcha_theme = $valid_data['appearance_settings']['recaptcha_theme']; |
629 | 628 | $EE_Registration_Config->recaptcha_language = $valid_data['appearance_settings']['recaptcha_language']; |
630 | 629 | } else { |
631 | - if ( $recaptcha_settings_form->submission_error_message() != '' ) { |
|
632 | - EE_Error::add_error( $recaptcha_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__ ); |
|
630 | + if ($recaptcha_settings_form->submission_error_message() != '') { |
|
631 | + EE_Error::add_error($recaptcha_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__); |
|
633 | 632 | } |
634 | 633 | } |
635 | 634 | } |
636 | - } catch( EE_Error $e ) { |
|
635 | + } catch (EE_Error $e) { |
|
637 | 636 | $e->get_error(); |
638 | 637 | } |
639 | 638 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use EventEspresso\core\libraries\iframe_display\Iframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -27,25 +27,25 @@ discard block |
||
27 | 27 | * @param \EED_Events_Archive $EED_Events_Archive |
28 | 28 | * @throws \EE_Error |
29 | 29 | */ |
30 | - public function __construct( $EED_Events_Archive ) |
|
30 | + public function __construct($EED_Events_Archive) |
|
31 | 31 | { |
32 | - \EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
32 | + \EE_Registry::instance()->REQ->set_espresso_page(true); |
|
33 | 33 | $EED_Events_Archive->event_list(); |
34 | 34 | $event_list = new \EES_Espresso_Events(); |
35 | 35 | parent::__construct( |
36 | - esc_html__( 'Event List', 'event_espresso' ), |
|
36 | + esc_html__('Event List', 'event_espresso'), |
|
37 | 37 | $event_list->process_shortcode() |
38 | 38 | ); |
39 | 39 | $this->addStylesheets( |
40 | 40 | apply_filters( |
41 | 41 | 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css', |
42 | 42 | array( |
43 | - 'espresso_default' => is_readable( EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css' ) |
|
44 | - ? EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION |
|
45 | - : EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
43 | + 'espresso_default' => is_readable(EVENT_ESPRESSO_UPLOAD_DIR.'css/style.css') |
|
44 | + ? EVENT_ESPRESSO_UPLOAD_DIR.'css/espresso_default.css?ver='.EVENT_ESPRESSO_VERSION |
|
45 | + : EE_GLOBAL_ASSETS_URL.'css/espresso_default.css?ver='.EVENT_ESPRESSO_VERSION, |
|
46 | 46 | $EED_Events_Archive->theme() => get_stylesheet_directory_uri() |
47 | - . $EED_Events_Archive->theme() . DS |
|
48 | - . 'style.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
47 | + . $EED_Events_Archive->theme().DS |
|
48 | + . 'style.css?ver='.EVENT_ESPRESSO_VERSION, |
|
49 | 49 | ) |
50 | 50 | ) |
51 | 51 | ); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | \EE_Registry::instance()->CFG->map_settings->google_map_api_key |
61 | 61 | ) |
62 | 62 | ), |
63 | - 'ee_gmap' => EE_HELPERS_ASSETS . 'ee_gmap.js?ver=1.0', |
|
63 | + 'ee_gmap' => EE_HELPERS_ASSETS.'ee_gmap.js?ver=1.0', |
|
64 | 64 | ) |
65 | 65 | ) |
66 | 66 | ); |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use EventEspresso\core\libraries\iframe_display\Iframe; |
5 | 5 | |
6 | 6 | if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
7 | - exit( 'No direct script access allowed' ); |
|
7 | + exit( 'No direct script access allowed' ); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -21,59 +21,59 @@ discard block |
||
21 | 21 | |
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * EventsArchiveIframe constructor. |
|
26 | - * |
|
27 | - * @param \EED_Events_Archive $EED_Events_Archive |
|
28 | - * @throws \DomainException |
|
29 | - */ |
|
30 | - public function __construct( $EED_Events_Archive ) |
|
31 | - { |
|
32 | - \EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
33 | - add_filter('FHEE__EED_Events_Archive__event_list_iframe', '__return_true'); |
|
34 | - $EED_Events_Archive->event_list(); |
|
35 | - $event_list = new \EES_Espresso_Events(); |
|
36 | - parent::__construct( |
|
37 | - esc_html__( 'Event List', 'event_espresso' ), |
|
38 | - $event_list->process_shortcode() |
|
39 | - ); |
|
40 | - $this->addStylesheets( |
|
41 | - apply_filters( |
|
42 | - 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css', |
|
43 | - array( |
|
44 | - 'espresso_default' => is_readable( EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css' ) |
|
45 | - ? EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION |
|
46 | - : EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
47 | - $EED_Events_Archive->theme() => get_stylesheet_directory_uri() |
|
48 | - . $EED_Events_Archive->theme() . DS |
|
49 | - . 'style.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
50 | - ), |
|
51 | - $this |
|
52 | - ) |
|
53 | - ); |
|
54 | - $this->addScripts( |
|
55 | - apply_filters( |
|
56 | - 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js', |
|
57 | - array( |
|
58 | - 'gmap_api' => sprintf( |
|
59 | - 'https://maps.googleapis.com/maps/api/js?key=%s', |
|
60 | - apply_filters( |
|
61 | - 'FHEE__EEH_Maps__espresso_google_maps_js__api_key', |
|
62 | - \EE_Registry::instance()->CFG->map_settings->google_map_api_key |
|
63 | - ) |
|
64 | - ), |
|
65 | - 'ee_gmap' => EE_HELPERS_ASSETS . 'ee_gmap.js?ver=1.0', |
|
66 | - ), |
|
67 | - $this |
|
68 | - ) |
|
69 | - ); |
|
70 | - $this->addLocalizedVars( |
|
71 | - array( |
|
72 | - 'ee_gmap' => \EEH_Maps::$gmap_vars, |
|
73 | - ), |
|
74 | - 'ee_gmap_vars' |
|
75 | - ); |
|
76 | - } |
|
24 | + /** |
|
25 | + * EventsArchiveIframe constructor. |
|
26 | + * |
|
27 | + * @param \EED_Events_Archive $EED_Events_Archive |
|
28 | + * @throws \DomainException |
|
29 | + */ |
|
30 | + public function __construct( $EED_Events_Archive ) |
|
31 | + { |
|
32 | + \EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
33 | + add_filter('FHEE__EED_Events_Archive__event_list_iframe', '__return_true'); |
|
34 | + $EED_Events_Archive->event_list(); |
|
35 | + $event_list = new \EES_Espresso_Events(); |
|
36 | + parent::__construct( |
|
37 | + esc_html__( 'Event List', 'event_espresso' ), |
|
38 | + $event_list->process_shortcode() |
|
39 | + ); |
|
40 | + $this->addStylesheets( |
|
41 | + apply_filters( |
|
42 | + 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css', |
|
43 | + array( |
|
44 | + 'espresso_default' => is_readable( EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css' ) |
|
45 | + ? EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION |
|
46 | + : EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
47 | + $EED_Events_Archive->theme() => get_stylesheet_directory_uri() |
|
48 | + . $EED_Events_Archive->theme() . DS |
|
49 | + . 'style.css?ver=' . EVENT_ESPRESSO_VERSION, |
|
50 | + ), |
|
51 | + $this |
|
52 | + ) |
|
53 | + ); |
|
54 | + $this->addScripts( |
|
55 | + apply_filters( |
|
56 | + 'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js', |
|
57 | + array( |
|
58 | + 'gmap_api' => sprintf( |
|
59 | + 'https://maps.googleapis.com/maps/api/js?key=%s', |
|
60 | + apply_filters( |
|
61 | + 'FHEE__EEH_Maps__espresso_google_maps_js__api_key', |
|
62 | + \EE_Registry::instance()->CFG->map_settings->google_map_api_key |
|
63 | + ) |
|
64 | + ), |
|
65 | + 'ee_gmap' => EE_HELPERS_ASSETS . 'ee_gmap.js?ver=1.0', |
|
66 | + ), |
|
67 | + $this |
|
68 | + ) |
|
69 | + ); |
|
70 | + $this->addLocalizedVars( |
|
71 | + array( |
|
72 | + 'ee_gmap' => \EEH_Maps::$gmap_vars, |
|
73 | + ), |
|
74 | + 'ee_gmap_vars' |
|
75 | + ); |
|
76 | + } |
|
77 | 77 | |
78 | 78 | |
79 | 79 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use EventEspresso\core\libraries\iframe_display\Iframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct() |
30 | 30 | { |
31 | - \EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
31 | + \EE_Registry::instance()->REQ->set_espresso_page(true); |
|
32 | 32 | /** @type \EEM_Event $EEM_Event */ |
33 | - $EEM_Event = \EE_Registry::instance()->load_model( 'Event' ); |
|
33 | + $EEM_Event = \EE_Registry::instance()->load_model('Event'); |
|
34 | 34 | $event = $EEM_Event->get_one_by_ID( |
35 | - \EE_Registry::instance()->REQ->get( 'event', 0 ) |
|
35 | + \EE_Registry::instance()->REQ->get('event', 0) |
|
36 | 36 | ); |
37 | 37 | $ticket_selector = new DisplayTicketSelector(); |
38 | - $ticket_selector->setIframe( true ); |
|
38 | + $ticket_selector->setIframe(true); |
|
39 | 39 | parent::__construct( |
40 | - esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
41 | - $ticket_selector->display( $event ) |
|
40 | + esc_html__('Ticket Selector', 'event_espresso'), |
|
41 | + $ticket_selector->display($event) |
|
42 | 42 | ); |
43 | 43 | $this->addStylesheets( |
44 | 44 | apply_filters( |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use EventEspresso\core\libraries\iframe_display\Iframe; |
5 | 5 | |
6 | 6 | if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
7 | - exit( 'No direct script access allowed' ); |
|
7 | + exit( 'No direct script access allowed' ); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -21,61 +21,61 @@ discard block |
||
21 | 21 | class TicketSelectorIframe extends Iframe |
22 | 22 | { |
23 | 23 | |
24 | - /** |
|
25 | - * TicketSelectorIframe constructor. |
|
26 | - * |
|
27 | - * @throws \DomainException |
|
28 | - * @throws \EE_Error |
|
29 | - */ |
|
30 | - public function __construct() |
|
31 | - { |
|
32 | - \EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
33 | - /** @type \EEM_Event $EEM_Event */ |
|
34 | - $EEM_Event = \EE_Registry::instance()->load_model( 'Event' ); |
|
35 | - $event = $EEM_Event->get_one_by_ID( |
|
36 | - \EE_Registry::instance()->REQ->get( 'event', 0 ) |
|
37 | - ); |
|
38 | - $ticket_selector = new DisplayTicketSelector(); |
|
39 | - $ticket_selector->setIframe( true ); |
|
40 | - parent::__construct( |
|
41 | - esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
42 | - $ticket_selector->display( $event ) |
|
43 | - ); |
|
44 | - $this->addStylesheets( |
|
45 | - apply_filters( |
|
46 | - 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css', |
|
47 | - array( |
|
48 | - 'ticket_selector_embed' => TICKET_SELECTOR_ASSETS_URL |
|
49 | - . 'ticket_selector_embed.css?ver=' |
|
50 | - . EVENT_ESPRESSO_VERSION, |
|
51 | - 'ticket_selector' => TICKET_SELECTOR_ASSETS_URL |
|
52 | - . 'ticket_selector.css?ver=' |
|
53 | - . EVENT_ESPRESSO_VERSION, |
|
54 | - ), |
|
55 | - $this |
|
56 | - ) |
|
57 | - ); |
|
58 | - $this->addScripts( |
|
59 | - apply_filters( |
|
60 | - 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
|
61 | - array( |
|
62 | - 'ticket_selector_iframe_embed' => TICKET_SELECTOR_ASSETS_URL |
|
63 | - . 'ticket_selector_iframe_embed.js?ver=' |
|
64 | - . EVENT_ESPRESSO_VERSION, |
|
65 | - ), |
|
66 | - $this |
|
67 | - ) |
|
68 | - ); |
|
69 | - $this->addLocalizedVars( |
|
70 | - array( |
|
71 | - 'ticket_selector_iframe' => true, |
|
72 | - 'EEDTicketSelectorMsg' => __( |
|
73 | - 'Please choose at least one ticket before continuing.', |
|
74 | - 'event_espresso' |
|
75 | - ), |
|
76 | - ) |
|
77 | - ); |
|
78 | - } |
|
24 | + /** |
|
25 | + * TicketSelectorIframe constructor. |
|
26 | + * |
|
27 | + * @throws \DomainException |
|
28 | + * @throws \EE_Error |
|
29 | + */ |
|
30 | + public function __construct() |
|
31 | + { |
|
32 | + \EE_Registry::instance()->REQ->set_espresso_page( true ); |
|
33 | + /** @type \EEM_Event $EEM_Event */ |
|
34 | + $EEM_Event = \EE_Registry::instance()->load_model( 'Event' ); |
|
35 | + $event = $EEM_Event->get_one_by_ID( |
|
36 | + \EE_Registry::instance()->REQ->get( 'event', 0 ) |
|
37 | + ); |
|
38 | + $ticket_selector = new DisplayTicketSelector(); |
|
39 | + $ticket_selector->setIframe( true ); |
|
40 | + parent::__construct( |
|
41 | + esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
42 | + $ticket_selector->display( $event ) |
|
43 | + ); |
|
44 | + $this->addStylesheets( |
|
45 | + apply_filters( |
|
46 | + 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css', |
|
47 | + array( |
|
48 | + 'ticket_selector_embed' => TICKET_SELECTOR_ASSETS_URL |
|
49 | + . 'ticket_selector_embed.css?ver=' |
|
50 | + . EVENT_ESPRESSO_VERSION, |
|
51 | + 'ticket_selector' => TICKET_SELECTOR_ASSETS_URL |
|
52 | + . 'ticket_selector.css?ver=' |
|
53 | + . EVENT_ESPRESSO_VERSION, |
|
54 | + ), |
|
55 | + $this |
|
56 | + ) |
|
57 | + ); |
|
58 | + $this->addScripts( |
|
59 | + apply_filters( |
|
60 | + 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
|
61 | + array( |
|
62 | + 'ticket_selector_iframe_embed' => TICKET_SELECTOR_ASSETS_URL |
|
63 | + . 'ticket_selector_iframe_embed.js?ver=' |
|
64 | + . EVENT_ESPRESSO_VERSION, |
|
65 | + ), |
|
66 | + $this |
|
67 | + ) |
|
68 | + ); |
|
69 | + $this->addLocalizedVars( |
|
70 | + array( |
|
71 | + 'ticket_selector_iframe' => true, |
|
72 | + 'EEDTicketSelectorMsg' => __( |
|
73 | + 'Please choose at least one ticket before continuing.', |
|
74 | + 'event_espresso' |
|
75 | + ), |
|
76 | + ) |
|
77 | + ); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | } |
81 | 81 | // End of file TicketSelectorIframe.php |
@@ -17,27 +17,27 @@ |
||
17 | 17 | class TicketSelectorIframeEmbedButton extends IframeEmbedButton |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * TicketSelectorIframeEmbedButton constructor. |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
25 | - parent::__construct( |
|
26 | - esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
27 | - 'ticket_selector' |
|
28 | - ); |
|
29 | - } |
|
30 | - |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Adds an iframe embed code button to the Event editor. |
|
35 | - */ |
|
36 | - public function addEventEditorIframeEmbedButton() |
|
37 | - { |
|
38 | - // add button for iframe code to event editor. |
|
39 | - $this->addEventEditorIframeEmbedButtonFilter(); |
|
40 | - } |
|
20 | + /** |
|
21 | + * TicketSelectorIframeEmbedButton constructor. |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | + parent::__construct( |
|
26 | + esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
27 | + 'ticket_selector' |
|
28 | + ); |
|
29 | + } |
|
30 | + |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Adds an iframe embed code button to the Event editor. |
|
35 | + */ |
|
36 | + public function addEventEditorIframeEmbedButton() |
|
37 | + { |
|
38 | + // add button for iframe code to event editor. |
|
39 | + $this->addEventEditorIframeEmbedButtonFilter(); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | |
43 | 43 |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use EventEspresso\core\libraries\iframe_display\IframeEmbedButton; |
5 | 5 | |
6 | -defined( 'ABSPATH' ) || exit; |
|
6 | +defined('ABSPATH') || exit; |
|
7 | 7 | |
8 | 8 | |
9 | 9 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function __construct() |
24 | 24 | { |
25 | 25 | parent::__construct( |
26 | - esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
26 | + esc_html__('Ticket Selector', 'event_espresso'), |
|
27 | 27 | 'ticket_selector' |
28 | 28 | ); |
29 | 29 | } |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use EventEspresso\core\libraries\iframe_display\Iframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | * @return mixed|null |
27 | 27 | * @throws \EE_Error |
28 | 28 | */ |
29 | - public static function create( $class_name, $arguments = array() ) { |
|
30 | - if ( empty( $class_name ) ) { |
|
29 | + public static function create($class_name, $arguments = array()) { |
|
30 | + if (empty($class_name)) { |
|
31 | 31 | throw new \EE_Error( |
32 | - __( 'You must provide a class name in order to instantiate it.', 'event_espresso' ) |
|
32 | + __('You must provide a class name in order to instantiate it.', 'event_espresso') |
|
33 | 33 | ); |
34 | 34 | } |
35 | 35 | // if ( ! class_exists( $class_name ) ) { |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | // ); |
42 | 42 | // } |
43 | 43 | $object = null; |
44 | - switch ( $class_name ) { |
|
44 | + switch ($class_name) { |
|
45 | 45 | |
46 | 46 | case 'EE_Request' : |
47 | - $object = new \EE_Request( $_GET, $_POST, $_COOKIE ); |
|
47 | + $object = new \EE_Request($_GET, $_POST, $_COOKIE); |
|
48 | 48 | break; |
49 | 49 | |
50 | 50 | case 'Iframe' : |
51 | - $title = isset( $arguments['title'] ) ? $arguments['title'] : null; |
|
52 | - $content = isset( $arguments['content'] ) ? $arguments['content'] : null; |
|
53 | - $object = new Iframe( $title, $content ); |
|
51 | + $title = isset($arguments['title']) ? $arguments['title'] : null; |
|
52 | + $content = isset($arguments['content']) ? $arguments['content'] : null; |
|
53 | + $object = new Iframe($title, $content); |
|
54 | 54 | break; |
55 | 55 | |
56 | 56 | default : |
57 | - $object = new $class_name( $arguments ); |
|
57 | + $object = new $class_name($arguments); |
|
58 | 58 | |
59 | 59 | } |
60 | 60 |