@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Deprecated functions from WordPress MU and the multisite feature. You shouldn't |
|
4 | - * use these functions and look for the alternatives instead. The functions will be |
|
5 | - * removed in a later version. |
|
6 | - * |
|
7 | - * @package WordPress |
|
8 | - * @subpackage Deprecated |
|
9 | - * @since 3.0.0 |
|
10 | - */ |
|
3 | + * Deprecated functions from WordPress MU and the multisite feature. You shouldn't |
|
4 | + * use these functions and look for the alternatives instead. The functions will be |
|
5 | + * removed in a later version. |
|
6 | + * |
|
7 | + * @package WordPress |
|
8 | + * @subpackage Deprecated |
|
9 | + * @since 3.0.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /* |
13 | 13 | * Deprecated functions come here to die. |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | * @return int Current site ID. |
25 | 25 | */ |
26 | 26 | function get_dashboard_blog() { |
27 | - _deprecated_function( __FUNCTION__, '3.1' ); |
|
28 | - if ( $blog = get_site_option( 'dashboard_blog' ) ) |
|
29 | - return get_blog_details( $blog ); |
|
27 | + _deprecated_function( __FUNCTION__, '3.1' ); |
|
28 | + if ( $blog = get_site_option( 'dashboard_blog' ) ) |
|
29 | + return get_blog_details( $blog ); |
|
30 | 30 | |
31 | - return get_blog_details( $GLOBALS['current_site']->blog_id ); |
|
31 | + return get_blog_details( $GLOBALS['current_site']->blog_id ); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | * @return int Current site ID. |
25 | 25 | */ |
26 | 26 | function get_dashboard_blog() { |
27 | - _deprecated_function( __FUNCTION__, '3.1' ); |
|
28 | - if ( $blog = get_site_option( 'dashboard_blog' ) ) |
|
29 | - return get_blog_details( $blog ); |
|
27 | + _deprecated_function(__FUNCTION__, '3.1'); |
|
28 | + if ($blog = get_site_option('dashboard_blog')) |
|
29 | + return get_blog_details($blog); |
|
30 | 30 | |
31 | - return get_blog_details( $GLOBALS['current_site']->blog_id ); |
|
31 | + return get_blog_details($GLOBALS['current_site']->blog_id); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param int $len Optional. The length of password to generate. Default 8. |
42 | 42 | */ |
43 | -function generate_random_password( $len = 8 ) { |
|
44 | - _deprecated_function( __FUNCTION__, '3.0', 'wp_generate_password()' ); |
|
45 | - return wp_generate_password( $len ); |
|
43 | +function generate_random_password($len = 8) { |
|
44 | + _deprecated_function(__FUNCTION__, '3.0', 'wp_generate_password()'); |
|
45 | + return wp_generate_password($len); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -60,24 +60,24 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @param string $user_login Optional. Username for the user to check. Default empty. |
62 | 62 | */ |
63 | -function is_site_admin( $user_login = '' ) { |
|
64 | - _deprecated_function( __FUNCTION__, '3.0', 'is_super_admin()' ); |
|
63 | +function is_site_admin($user_login = '') { |
|
64 | + _deprecated_function(__FUNCTION__, '3.0', 'is_super_admin()'); |
|
65 | 65 | |
66 | - if ( empty( $user_login ) ) { |
|
66 | + if (empty($user_login)) { |
|
67 | 67 | $user_id = get_current_user_id(); |
68 | - if ( !$user_id ) |
|
68 | + if ( ! $user_id) |
|
69 | 69 | return false; |
70 | 70 | } else { |
71 | - $user = get_user_by( 'login', $user_login ); |
|
72 | - if ( ! $user->exists() ) |
|
71 | + $user = get_user_by('login', $user_login); |
|
72 | + if ( ! $user->exists()) |
|
73 | 73 | return false; |
74 | 74 | $user_id = $user->ID; |
75 | 75 | } |
76 | 76 | |
77 | - return is_super_admin( $user_id ); |
|
77 | + return is_super_admin($user_id); |
|
78 | 78 | } |
79 | 79 | |
80 | -if ( !function_exists( 'graceful_fail' ) ) : |
|
80 | +if ( ! function_exists('graceful_fail')) : |
|
81 | 81 | /** |
82 | 82 | * Deprecated functionality to gracefully fail. |
83 | 83 | * |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | * @deprecated 3.0.0 Use wp_die() |
86 | 86 | * @see wp_die() |
87 | 87 | */ |
88 | -function graceful_fail( $message ) { |
|
89 | - _deprecated_function( __FUNCTION__, '3.0', 'wp_die()' ); |
|
90 | - $message = apply_filters( 'graceful_fail', $message ); |
|
91 | - $message_template = apply_filters( 'graceful_fail_template', |
|
88 | +function graceful_fail($message) { |
|
89 | + _deprecated_function(__FUNCTION__, '3.0', 'wp_die()'); |
|
90 | + $message = apply_filters('graceful_fail', $message); |
|
91 | + $message_template = apply_filters('graceful_fail_template', |
|
92 | 92 | '<!DOCTYPE html> |
93 | 93 | <html xmlns="http://www.w3.org/1999/xhtml"><head> |
94 | 94 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | <p class="message">%s</p> |
113 | 113 | </body> |
114 | 114 | </html>' ); |
115 | - die( sprintf( $message_template, $message ) ); |
|
115 | + die(sprintf($message_template, $message)); |
|
116 | 116 | } |
117 | 117 | endif; |
118 | 118 | |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @param string $username Username. |
127 | 127 | */ |
128 | -function get_user_details( $username ) { |
|
129 | - _deprecated_function( __FUNCTION__, '3.0', 'get_user_by()' ); |
|
128 | +function get_user_details($username) { |
|
129 | + _deprecated_function(__FUNCTION__, '3.0', 'get_user_by()'); |
|
130 | 130 | return get_user_by('login', $username); |
131 | 131 | } |
132 | 132 | |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @param int $post_id Post ID. |
141 | 141 | */ |
142 | -function clear_global_post_cache( $post_id ) { |
|
143 | - _deprecated_function( __FUNCTION__, '3.0', 'clean_post_cache()' ); |
|
142 | +function clear_global_post_cache($post_id) { |
|
143 | + _deprecated_function(__FUNCTION__, '3.0', 'clean_post_cache()'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @see is_main_site() |
152 | 152 | */ |
153 | 153 | function is_main_blog() { |
154 | - _deprecated_function( __FUNCTION__, '3.0', 'is_main_site()' ); |
|
154 | + _deprecated_function(__FUNCTION__, '3.0', 'is_main_site()'); |
|
155 | 155 | return is_main_site(); |
156 | 156 | } |
157 | 157 | |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | * @param bool $check_domain Deprecated. |
167 | 167 | * @return string|bool Either false or the valid email address. |
168 | 168 | */ |
169 | -function validate_email( $email, $check_domain = true) { |
|
170 | - _deprecated_function( __FUNCTION__, '3.0', 'is_email()' ); |
|
171 | - return is_email( $email, $check_domain ); |
|
169 | +function validate_email($email, $check_domain = true) { |
|
170 | + _deprecated_function(__FUNCTION__, '3.0', 'is_email()'); |
|
171 | + return is_email($email, $check_domain); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -182,26 +182,26 @@ discard block |
||
182 | 182 | * @param int $num Optional. Number of blogs to list. Default 10. |
183 | 183 | * @param string $deprecated Unused. |
184 | 184 | */ |
185 | -function get_blog_list( $start = 0, $num = 10, $deprecated = '' ) { |
|
186 | - _deprecated_function( __FUNCTION__, '3.0', 'wp_get_sites()' ); |
|
185 | +function get_blog_list($start = 0, $num = 10, $deprecated = '') { |
|
186 | + _deprecated_function(__FUNCTION__, '3.0', 'wp_get_sites()'); |
|
187 | 187 | |
188 | 188 | global $wpdb; |
189 | - $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A ); |
|
189 | + $blogs = $wpdb->get_results($wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A); |
|
190 | 190 | |
191 | 191 | $blog_list = array(); |
192 | - foreach ( (array) $blogs as $details ) { |
|
193 | - $blog_list[ $details['blog_id'] ] = $details; |
|
194 | - $blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->get_blog_prefix( $details['blog_id'] ). "posts WHERE post_status='publish' AND post_type='post'" ); |
|
192 | + foreach ((array) $blogs as $details) { |
|
193 | + $blog_list[$details['blog_id']] = $details; |
|
194 | + $blog_list[$details['blog_id']]['postcount'] = $wpdb->get_var("SELECT COUNT(ID) FROM ".$wpdb->get_blog_prefix($details['blog_id'])."posts WHERE post_status='publish' AND post_type='post'"); |
|
195 | 195 | } |
196 | 196 | |
197 | - if ( ! $blog_list ) { |
|
197 | + if ( ! $blog_list) { |
|
198 | 198 | return array(); |
199 | 199 | } |
200 | 200 | |
201 | - if ( $num == 'all' ) { |
|
202 | - return array_slice( $blog_list, $start, count( $blog_list ) ); |
|
201 | + if ($num == 'all') { |
|
202 | + return array_slice($blog_list, $start, count($blog_list)); |
|
203 | 203 | } else { |
204 | - return array_slice( $blog_list, $start, $num ); |
|
204 | + return array_slice($blog_list, $start, $num); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
@@ -215,38 +215,38 @@ discard block |
||
215 | 215 | * @param bool $display Optional. Whether or not to display the most active blogs list. Default true. |
216 | 216 | * @return array List of "most active" sites. |
217 | 217 | */ |
218 | -function get_most_active_blogs( $num = 10, $display = true ) { |
|
219 | - _deprecated_function( __FUNCTION__, '3.0' ); |
|
218 | +function get_most_active_blogs($num = 10, $display = true) { |
|
219 | + _deprecated_function(__FUNCTION__, '3.0'); |
|
220 | 220 | |
221 | - $blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details |
|
222 | - if ( is_array( $blogs ) ) { |
|
223 | - reset( $blogs ); |
|
221 | + $blogs = get_blog_list(0, 'all', false); // $blog_id -> $details |
|
222 | + if (is_array($blogs)) { |
|
223 | + reset($blogs); |
|
224 | 224 | $most_active = array(); |
225 | 225 | $blog_list = array(); |
226 | - foreach ( (array) $blogs as $key => $details ) { |
|
227 | - $most_active[ $details['blog_id'] ] = $details['postcount']; |
|
228 | - $blog_list[ $details['blog_id'] ] = $details; // array_slice() removes keys!! |
|
226 | + foreach ((array) $blogs as $key => $details) { |
|
227 | + $most_active[$details['blog_id']] = $details['postcount']; |
|
228 | + $blog_list[$details['blog_id']] = $details; // array_slice() removes keys!! |
|
229 | 229 | } |
230 | - arsort( $most_active ); |
|
231 | - reset( $most_active ); |
|
230 | + arsort($most_active); |
|
231 | + reset($most_active); |
|
232 | 232 | $t = array(); |
233 | - foreach ( (array) $most_active as $key => $details ) { |
|
234 | - $t[ $key ] = $blog_list[ $key ]; |
|
233 | + foreach ((array) $most_active as $key => $details) { |
|
234 | + $t[$key] = $blog_list[$key]; |
|
235 | 235 | } |
236 | - unset( $most_active ); |
|
236 | + unset($most_active); |
|
237 | 237 | $most_active = $t; |
238 | 238 | } |
239 | 239 | |
240 | - if ( $display ) { |
|
241 | - if ( is_array( $most_active ) ) { |
|
242 | - reset( $most_active ); |
|
243 | - foreach ( (array) $most_active as $key => $details ) { |
|
244 | - $url = esc_url('http://' . $details['domain'] . $details['path']); |
|
245 | - echo '<li>' . $details['postcount'] . " <a href='$url'>$url</a></li>"; |
|
240 | + if ($display) { |
|
241 | + if (is_array($most_active)) { |
|
242 | + reset($most_active); |
|
243 | + foreach ((array) $most_active as $key => $details) { |
|
244 | + $url = esc_url('http://'.$details['domain'].$details['path']); |
|
245 | + echo '<li>'.$details['postcount']." <a href='$url'>$url</a></li>"; |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 | } |
249 | - return array_slice( $most_active, 0, $num ); |
|
249 | + return array_slice($most_active, 0, $num); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -266,33 +266,33 @@ discard block |
||
266 | 266 | * |
267 | 267 | * @param string $url Optional. Redirect URL. Default empty. |
268 | 268 | */ |
269 | -function wpmu_admin_do_redirect( $url = '' ) { |
|
270 | - _deprecated_function( __FUNCTION__, '3.3' ); |
|
269 | +function wpmu_admin_do_redirect($url = '') { |
|
270 | + _deprecated_function(__FUNCTION__, '3.3'); |
|
271 | 271 | |
272 | 272 | $ref = ''; |
273 | - if ( isset( $_GET['ref'] ) ) |
|
273 | + if (isset($_GET['ref'])) |
|
274 | 274 | $ref = $_GET['ref']; |
275 | - if ( isset( $_POST['ref'] ) ) |
|
275 | + if (isset($_POST['ref'])) |
|
276 | 276 | $ref = $_POST['ref']; |
277 | 277 | |
278 | - if ( $ref ) { |
|
279 | - $ref = wpmu_admin_redirect_add_updated_param( $ref ); |
|
280 | - wp_redirect( $ref ); |
|
278 | + if ($ref) { |
|
279 | + $ref = wpmu_admin_redirect_add_updated_param($ref); |
|
280 | + wp_redirect($ref); |
|
281 | 281 | exit(); |
282 | 282 | } |
283 | - if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) { |
|
284 | - wp_redirect( $_SERVER['HTTP_REFERER'] ); |
|
283 | + if ( ! empty($_SERVER['HTTP_REFERER'])) { |
|
284 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
285 | 285 | exit(); |
286 | 286 | } |
287 | 287 | |
288 | - $url = wpmu_admin_redirect_add_updated_param( $url ); |
|
289 | - if ( isset( $_GET['redirect'] ) ) { |
|
290 | - if ( substr( $_GET['redirect'], 0, 2 ) == 's_' ) |
|
291 | - $url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) ); |
|
292 | - } elseif ( isset( $_POST['redirect'] ) ) { |
|
293 | - $url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] ); |
|
288 | + $url = wpmu_admin_redirect_add_updated_param($url); |
|
289 | + if (isset($_GET['redirect'])) { |
|
290 | + if (substr($_GET['redirect'], 0, 2) == 's_') |
|
291 | + $url .= '&action=blogs&s='.esc_html(substr($_GET['redirect'], 2)); |
|
292 | + } elseif (isset($_POST['redirect'])) { |
|
293 | + $url = wpmu_admin_redirect_add_updated_param($_POST['redirect']); |
|
294 | 294 | } |
295 | - wp_redirect( $url ); |
|
295 | + wp_redirect($url); |
|
296 | 296 | exit(); |
297 | 297 | } |
298 | 298 | |
@@ -306,14 +306,14 @@ discard block |
||
306 | 306 | * @param string $url Optional. Redirect URL. Default empty. |
307 | 307 | * @return string |
308 | 308 | */ |
309 | -function wpmu_admin_redirect_add_updated_param( $url = '' ) { |
|
310 | - _deprecated_function( __FUNCTION__, '3.3' ); |
|
309 | +function wpmu_admin_redirect_add_updated_param($url = '') { |
|
310 | + _deprecated_function(__FUNCTION__, '3.3'); |
|
311 | 311 | |
312 | - if ( strpos( $url, 'updated=true' ) === false ) { |
|
313 | - if ( strpos( $url, '?' ) === false ) |
|
314 | - return $url . '?updated=true'; |
|
312 | + if (strpos($url, 'updated=true') === false) { |
|
313 | + if (strpos($url, '?') === false) |
|
314 | + return $url.'?updated=true'; |
|
315 | 315 | else |
316 | - return $url . '&updated=true'; |
|
316 | + return $url.'&updated=true'; |
|
317 | 317 | } |
318 | 318 | return $url; |
319 | 319 | } |
@@ -331,17 +331,17 @@ discard block |
||
331 | 331 | * @param string $string Either an email address or a login. |
332 | 332 | * @return int |
333 | 333 | */ |
334 | -function get_user_id_from_string( $string ) { |
|
335 | - _deprecated_function( __FUNCTION__, '3.6', 'get_user_by()' ); |
|
334 | +function get_user_id_from_string($string) { |
|
335 | + _deprecated_function(__FUNCTION__, '3.6', 'get_user_by()'); |
|
336 | 336 | |
337 | - if ( is_email( $string ) ) |
|
338 | - $user = get_user_by( 'email', $string ); |
|
339 | - elseif ( is_numeric( $string ) ) |
|
337 | + if (is_email($string)) |
|
338 | + $user = get_user_by('email', $string); |
|
339 | + elseif (is_numeric($string)) |
|
340 | 340 | return $string; |
341 | 341 | else |
342 | - $user = get_user_by( 'login', $string ); |
|
342 | + $user = get_user_by('login', $string); |
|
343 | 343 | |
344 | - if ( $user ) |
|
344 | + if ($user) |
|
345 | 345 | return $user->ID; |
346 | 346 | return 0; |
347 | 347 | } |
@@ -356,23 +356,23 @@ discard block |
||
356 | 356 | * @param string $path |
357 | 357 | * @return string |
358 | 358 | */ |
359 | -function get_blogaddress_by_domain( $domain, $path ) { |
|
360 | - _deprecated_function( __FUNCTION__, '3.7' ); |
|
359 | +function get_blogaddress_by_domain($domain, $path) { |
|
360 | + _deprecated_function(__FUNCTION__, '3.7'); |
|
361 | 361 | |
362 | - if ( is_subdomain_install() ) { |
|
363 | - $url = "http://" . $domain.$path; |
|
362 | + if (is_subdomain_install()) { |
|
363 | + $url = "http://".$domain.$path; |
|
364 | 364 | } else { |
365 | - if ( $domain != $_SERVER['HTTP_HOST'] ) { |
|
366 | - $blogname = substr( $domain, 0, strpos( $domain, '.' ) ); |
|
367 | - $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path; |
|
365 | + if ($domain != $_SERVER['HTTP_HOST']) { |
|
366 | + $blogname = substr($domain, 0, strpos($domain, '.')); |
|
367 | + $url = 'http://'.substr($domain, strpos($domain, '.') + 1).$path; |
|
368 | 368 | // we're not installing the main blog |
369 | - if ( $blogname != 'www.' ) |
|
370 | - $url .= $blogname . '/'; |
|
369 | + if ($blogname != 'www.') |
|
370 | + $url .= $blogname.'/'; |
|
371 | 371 | } else { // main blog |
372 | - $url = 'http://' . $domain . $path; |
|
372 | + $url = 'http://'.$domain.$path; |
|
373 | 373 | } |
374 | 374 | } |
375 | - return esc_url_raw( $url ); |
|
375 | + return esc_url_raw($url); |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
@@ -387,22 +387,22 @@ discard block |
||
387 | 387 | * @param int $site_id Optional. Defaults to 1. |
388 | 388 | * @return string|int The ID of the newly created blog |
389 | 389 | */ |
390 | -function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { |
|
391 | - _deprecated_function( __FUNCTION__, '4.4' ); |
|
390 | +function create_empty_blog($domain, $path, $weblog_title, $site_id = 1) { |
|
391 | + _deprecated_function(__FUNCTION__, '4.4'); |
|
392 | 392 | |
393 | - if ( empty($path) ) |
|
393 | + if (empty($path)) |
|
394 | 394 | $path = '/'; |
395 | 395 | |
396 | 396 | // Check if the domain has been used already. We should return an error message. |
397 | - if ( domain_exists($domain, $path, $site_id) ) |
|
398 | - return __( '<strong>ERROR</strong>: Site URL already taken.' ); |
|
397 | + if (domain_exists($domain, $path, $site_id)) |
|
398 | + return __('<strong>ERROR</strong>: Site URL already taken.'); |
|
399 | 399 | |
400 | 400 | // Need to back up wpdb table names, and create a new wp_blogs entry for new blog. |
401 | 401 | // Need to get blog_id from wp_blogs, and create new table names. |
402 | 402 | // Must restore table names at the end of function. |
403 | 403 | |
404 | - if ( ! $blog_id = insert_blog($domain, $path, $site_id) ) |
|
405 | - return __( '<strong>ERROR</strong>: problem creating site entry.' ); |
|
404 | + if ( ! $blog_id = insert_blog($domain, $path, $site_id)) |
|
405 | + return __('<strong>ERROR</strong>: problem creating site entry.'); |
|
406 | 406 | |
407 | 407 | switch_to_blog($blog_id); |
408 | 408 | install_blog($blog_id); |
@@ -423,18 +423,18 @@ discard block |
||
423 | 423 | * @param string $path Optional. Site path. |
424 | 424 | * @return array|false The network admins |
425 | 425 | */ |
426 | -function get_admin_users_for_domain( $sitedomain = '', $path = '' ) { |
|
427 | - _deprecated_function( __FUNCTION__, '4.4' ); |
|
426 | +function get_admin_users_for_domain($sitedomain = '', $path = '') { |
|
427 | + _deprecated_function(__FUNCTION__, '4.4'); |
|
428 | 428 | |
429 | 429 | global $wpdb; |
430 | 430 | |
431 | - if ( ! $sitedomain ) |
|
431 | + if ( ! $sitedomain) |
|
432 | 432 | $site_id = $wpdb->siteid; |
433 | 433 | else |
434 | - $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) ); |
|
434 | + $site_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path)); |
|
435 | 435 | |
436 | - if ( $site_id ) |
|
437 | - return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A ); |
|
436 | + if ($site_id) |
|
437 | + return $wpdb->get_results($wpdb->prepare("SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id), ARRAY_A); |
|
438 | 438 | |
439 | 439 | return false; |
440 | 440 | } |
@@ -25,8 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function get_dashboard_blog() { |
27 | 27 | _deprecated_function( __FUNCTION__, '3.1' ); |
28 | - if ( $blog = get_site_option( 'dashboard_blog' ) ) |
|
29 | - return get_blog_details( $blog ); |
|
28 | + if ( $blog = get_site_option( 'dashboard_blog' ) ) { |
|
29 | + return get_blog_details( $blog ); |
|
30 | + } |
|
30 | 31 | |
31 | 32 | return get_blog_details( $GLOBALS['current_site']->blog_id ); |
32 | 33 | } |
@@ -65,12 +66,14 @@ discard block |
||
65 | 66 | |
66 | 67 | if ( empty( $user_login ) ) { |
67 | 68 | $user_id = get_current_user_id(); |
68 | - if ( !$user_id ) |
|
69 | - return false; |
|
69 | + if ( !$user_id ) { |
|
70 | + return false; |
|
71 | + } |
|
70 | 72 | } else { |
71 | 73 | $user = get_user_by( 'login', $user_login ); |
72 | - if ( ! $user->exists() ) |
|
73 | - return false; |
|
74 | + if ( ! $user->exists() ) { |
|
75 | + return false; |
|
76 | + } |
|
74 | 77 | $user_id = $user->ID; |
75 | 78 | } |
76 | 79 | |
@@ -270,10 +273,12 @@ discard block |
||
270 | 273 | _deprecated_function( __FUNCTION__, '3.3' ); |
271 | 274 | |
272 | 275 | $ref = ''; |
273 | - if ( isset( $_GET['ref'] ) ) |
|
274 | - $ref = $_GET['ref']; |
|
275 | - if ( isset( $_POST['ref'] ) ) |
|
276 | - $ref = $_POST['ref']; |
|
276 | + if ( isset( $_GET['ref'] ) ) { |
|
277 | + $ref = $_GET['ref']; |
|
278 | + } |
|
279 | + if ( isset( $_POST['ref'] ) ) { |
|
280 | + $ref = $_POST['ref']; |
|
281 | + } |
|
277 | 282 | |
278 | 283 | if ( $ref ) { |
279 | 284 | $ref = wpmu_admin_redirect_add_updated_param( $ref ); |
@@ -287,8 +292,9 @@ discard block |
||
287 | 292 | |
288 | 293 | $url = wpmu_admin_redirect_add_updated_param( $url ); |
289 | 294 | if ( isset( $_GET['redirect'] ) ) { |
290 | - if ( substr( $_GET['redirect'], 0, 2 ) == 's_' ) |
|
291 | - $url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) ); |
|
295 | + if ( substr( $_GET['redirect'], 0, 2 ) == 's_' ) { |
|
296 | + $url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) ); |
|
297 | + } |
|
292 | 298 | } elseif ( isset( $_POST['redirect'] ) ) { |
293 | 299 | $url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] ); |
294 | 300 | } |
@@ -310,10 +316,11 @@ discard block |
||
310 | 316 | _deprecated_function( __FUNCTION__, '3.3' ); |
311 | 317 | |
312 | 318 | if ( strpos( $url, 'updated=true' ) === false ) { |
313 | - if ( strpos( $url, '?' ) === false ) |
|
314 | - return $url . '?updated=true'; |
|
315 | - else |
|
316 | - return $url . '&updated=true'; |
|
319 | + if ( strpos( $url, '?' ) === false ) { |
|
320 | + return $url . '?updated=true'; |
|
321 | + } else { |
|
322 | + return $url . '&updated=true'; |
|
323 | + } |
|
317 | 324 | } |
318 | 325 | return $url; |
319 | 326 | } |
@@ -334,15 +341,17 @@ discard block |
||
334 | 341 | function get_user_id_from_string( $string ) { |
335 | 342 | _deprecated_function( __FUNCTION__, '3.6', 'get_user_by()' ); |
336 | 343 | |
337 | - if ( is_email( $string ) ) |
|
338 | - $user = get_user_by( 'email', $string ); |
|
339 | - elseif ( is_numeric( $string ) ) |
|
340 | - return $string; |
|
341 | - else |
|
342 | - $user = get_user_by( 'login', $string ); |
|
344 | + if ( is_email( $string ) ) { |
|
345 | + $user = get_user_by( 'email', $string ); |
|
346 | + } elseif ( is_numeric( $string ) ) { |
|
347 | + return $string; |
|
348 | + } else { |
|
349 | + $user = get_user_by( 'login', $string ); |
|
350 | + } |
|
343 | 351 | |
344 | - if ( $user ) |
|
345 | - return $user->ID; |
|
352 | + if ( $user ) { |
|
353 | + return $user->ID; |
|
354 | + } |
|
346 | 355 | return 0; |
347 | 356 | } |
348 | 357 | |
@@ -366,8 +375,9 @@ discard block |
||
366 | 375 | $blogname = substr( $domain, 0, strpos( $domain, '.' ) ); |
367 | 376 | $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path; |
368 | 377 | // we're not installing the main blog |
369 | - if ( $blogname != 'www.' ) |
|
370 | - $url .= $blogname . '/'; |
|
378 | + if ( $blogname != 'www.' ) { |
|
379 | + $url .= $blogname . '/'; |
|
380 | + } |
|
371 | 381 | } else { // main blog |
372 | 382 | $url = 'http://' . $domain . $path; |
373 | 383 | } |
@@ -390,19 +400,22 @@ discard block |
||
390 | 400 | function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { |
391 | 401 | _deprecated_function( __FUNCTION__, '4.4' ); |
392 | 402 | |
393 | - if ( empty($path) ) |
|
394 | - $path = '/'; |
|
403 | + if ( empty($path) ) { |
|
404 | + $path = '/'; |
|
405 | + } |
|
395 | 406 | |
396 | 407 | // Check if the domain has been used already. We should return an error message. |
397 | - if ( domain_exists($domain, $path, $site_id) ) |
|
398 | - return __( '<strong>ERROR</strong>: Site URL already taken.' ); |
|
408 | + if ( domain_exists($domain, $path, $site_id) ) { |
|
409 | + return __( '<strong>ERROR</strong>: Site URL already taken.' ); |
|
410 | + } |
|
399 | 411 | |
400 | 412 | // Need to back up wpdb table names, and create a new wp_blogs entry for new blog. |
401 | 413 | // Need to get blog_id from wp_blogs, and create new table names. |
402 | 414 | // Must restore table names at the end of function. |
403 | 415 | |
404 | - if ( ! $blog_id = insert_blog($domain, $path, $site_id) ) |
|
405 | - return __( '<strong>ERROR</strong>: problem creating site entry.' ); |
|
416 | + if ( ! $blog_id = insert_blog($domain, $path, $site_id) ) { |
|
417 | + return __( '<strong>ERROR</strong>: problem creating site entry.' ); |
|
418 | + } |
|
406 | 419 | |
407 | 420 | switch_to_blog($blog_id); |
408 | 421 | install_blog($blog_id); |
@@ -428,13 +441,15 @@ discard block |
||
428 | 441 | |
429 | 442 | global $wpdb; |
430 | 443 | |
431 | - if ( ! $sitedomain ) |
|
432 | - $site_id = $wpdb->siteid; |
|
433 | - else |
|
434 | - $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) ); |
|
444 | + if ( ! $sitedomain ) { |
|
445 | + $site_id = $wpdb->siteid; |
|
446 | + } else { |
|
447 | + $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) ); |
|
448 | + } |
|
435 | 449 | |
436 | - if ( $site_id ) |
|
437 | - return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A ); |
|
450 | + if ( $site_id ) { |
|
451 | + return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A ); |
|
452 | + } |
|
438 | 453 | |
439 | 454 | return false; |
440 | 455 | } |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Navigation Menu template functions |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Nav_Menus |
|
7 | - * @since 3.0.0 |
|
8 | - */ |
|
3 | + * Navigation Menu template functions |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Nav_Menus |
|
7 | + * @since 3.0.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Create HTML list of nav menu items. |
@@ -272,8 +272,9 @@ discard block |
||
272 | 272 | $menu = wp_get_nav_menu_object( $args->menu ); |
273 | 273 | |
274 | 274 | // Get the nav menu based on the theme_location |
275 | - if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) |
|
276 | - $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); |
|
275 | + if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) { |
|
276 | + $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); |
|
277 | + } |
|
277 | 278 | |
278 | 279 | // get the first menu that has items if we still can't find a menu |
279 | 280 | if ( ! $menu && !$args->theme_location ) { |
@@ -291,8 +292,9 @@ discard block |
||
291 | 292 | } |
292 | 293 | |
293 | 294 | // If the menu exists, get its items. |
294 | - if ( $menu && ! is_wp_error($menu) && !isset($menu_items) ) |
|
295 | - $menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) ); |
|
295 | + if ( $menu && ! is_wp_error($menu) && !isset($menu_items) ) { |
|
296 | + $menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) ); |
|
297 | + } |
|
296 | 298 | |
297 | 299 | /* |
298 | 300 | * If no menu was found: |
@@ -303,11 +305,13 @@ discard block |
||
303 | 305 | * - Otherwise, bail. |
304 | 306 | */ |
305 | 307 | if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) ) |
306 | - && isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) ) |
|
307 | - return call_user_func( $args->fallback_cb, (array) $args ); |
|
308 | + && isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) ) { |
|
309 | + return call_user_func( $args->fallback_cb, (array) $args ); |
|
310 | + } |
|
308 | 311 | |
309 | - if ( ! $menu || is_wp_error( $menu ) ) |
|
310 | - return false; |
|
312 | + if ( ! $menu || is_wp_error( $menu ) ) { |
|
313 | + return false; |
|
314 | + } |
|
311 | 315 | |
312 | 316 | $nav_menu = $items = ''; |
313 | 317 | |
@@ -336,15 +340,17 @@ discard block |
||
336 | 340 | $sorted_menu_items = $menu_items_with_children = array(); |
337 | 341 | foreach ( (array) $menu_items as $menu_item ) { |
338 | 342 | $sorted_menu_items[ $menu_item->menu_order ] = $menu_item; |
339 | - if ( $menu_item->menu_item_parent ) |
|
340 | - $menu_items_with_children[ $menu_item->menu_item_parent ] = true; |
|
343 | + if ( $menu_item->menu_item_parent ) { |
|
344 | + $menu_items_with_children[ $menu_item->menu_item_parent ] = true; |
|
345 | + } |
|
341 | 346 | } |
342 | 347 | |
343 | 348 | // Add the menu-item-has-children class where applicable |
344 | 349 | if ( $menu_items_with_children ) { |
345 | 350 | foreach ( $sorted_menu_items as &$menu_item ) { |
346 | - if ( isset( $menu_items_with_children[ $menu_item->ID ] ) ) |
|
347 | - $menu_item->classes[] = 'menu-item-has-children'; |
|
351 | + if ( isset( $menu_items_with_children[ $menu_item->ID ] ) ) { |
|
352 | + $menu_item->classes[] = 'menu-item-has-children'; |
|
353 | + } |
|
348 | 354 | } |
349 | 355 | } |
350 | 356 | |
@@ -369,10 +375,11 @@ discard block |
||
369 | 375 | } else { |
370 | 376 | $wrap_id = 'menu-' . $menu->slug; |
371 | 377 | while ( in_array( $wrap_id, $menu_id_slugs ) ) { |
372 | - if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) |
|
373 | - $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id ); |
|
374 | - else |
|
375 | - $wrap_id = $wrap_id . '-1'; |
|
378 | + if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) { |
|
379 | + $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id ); |
|
380 | + } else { |
|
381 | + $wrap_id = $wrap_id . '-1'; |
|
382 | + } |
|
376 | 383 | } |
377 | 384 | } |
378 | 385 | $menu_id_slugs[] = $wrap_id; |
@@ -403,14 +410,16 @@ discard block |
||
403 | 410 | $items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args ); |
404 | 411 | |
405 | 412 | // Don't print any markup if there are no items at this point. |
406 | - if ( empty( $items ) ) |
|
407 | - return false; |
|
413 | + if ( empty( $items ) ) { |
|
414 | + return false; |
|
415 | + } |
|
408 | 416 | |
409 | 417 | $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items ); |
410 | 418 | unset( $items ); |
411 | 419 | |
412 | - if ( $show_container ) |
|
413 | - $nav_menu .= '</' . $args->container . '>'; |
|
420 | + if ( $show_container ) { |
|
421 | + $nav_menu .= '</' . $args->container . '>'; |
|
422 | + } |
|
414 | 423 | |
415 | 424 | /** |
416 | 425 | * Filter the HTML content for navigation menus. |
@@ -424,11 +433,12 @@ discard block |
||
424 | 433 | */ |
425 | 434 | $nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args ); |
426 | 435 | |
427 | - if ( $args->echo ) |
|
428 | - echo $nav_menu; |
|
429 | - else |
|
430 | - return $nav_menu; |
|
431 | -} |
|
436 | + if ( $args->echo ) { |
|
437 | + echo $nav_menu; |
|
438 | + } else { |
|
439 | + return $nav_menu; |
|
440 | + } |
|
441 | + } |
|
432 | 442 | |
433 | 443 | /** |
434 | 444 | * Add the class property classes for the current context, if applicable. |
@@ -464,8 +474,9 @@ discard block |
||
464 | 474 | $possible_object_parents = array_merge( $possible_object_parents, $terms ); |
465 | 475 | $term_to_ancestor = array(); |
466 | 476 | foreach ( (array) $term_hierarchy as $anc => $descs ) { |
467 | - foreach ( (array) $descs as $desc ) |
|
468 | - $term_to_ancestor[ $desc ] = $anc; |
|
477 | + foreach ( (array) $descs as $desc ) { |
|
478 | + $term_to_ancestor[ $desc ] = $anc; |
|
479 | + } |
|
469 | 480 | } |
470 | 481 | |
471 | 482 | foreach ( $terms as $desc ) { |
@@ -487,8 +498,9 @@ discard block |
||
487 | 498 | $term_hierarchy = _get_term_hierarchy( $queried_object->taxonomy ); |
488 | 499 | $term_to_ancestor = array(); |
489 | 500 | foreach ( (array) $term_hierarchy as $anc => $descs ) { |
490 | - foreach ( (array) $descs as $desc ) |
|
491 | - $term_to_ancestor[ $desc ] = $anc; |
|
501 | + foreach ( (array) $descs as $desc ) { |
|
502 | + $term_to_ancestor[ $desc ] = $anc; |
|
503 | + } |
|
492 | 504 | } |
493 | 505 | $desc = $queried_object->term_id; |
494 | 506 | do { |
@@ -585,13 +597,15 @@ discard block |
||
585 | 597 | $classes[] = 'current-menu-item'; |
586 | 598 | } |
587 | 599 | |
588 | - if ( untrailingslashit($item_url) == home_url() ) |
|
589 | - $classes[] = 'menu-item-home'; |
|
600 | + if ( untrailingslashit($item_url) == home_url() ) { |
|
601 | + $classes[] = 'menu-item-home'; |
|
602 | + } |
|
590 | 603 | } |
591 | 604 | |
592 | 605 | // back-compat with wp_page_menu: add "current_page_parent" to static home page link for any non-page query |
593 | - if ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id ) |
|
594 | - $classes[] = 'current_page_parent'; |
|
606 | + if ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id ) { |
|
607 | + $classes[] = 'current_page_parent'; |
|
608 | + } |
|
595 | 609 | |
596 | 610 | $menu_items[$key]->classes = array_unique( $classes ); |
597 | 611 | } |
@@ -640,15 +654,18 @@ discard block |
||
640 | 654 | $classes[] = 'current-menu-parent'; |
641 | 655 | $menu_items[$key]->current_item_parent = true; |
642 | 656 | } |
643 | - if ( in_array( $parent_item->object_id, $active_parent_object_ids ) ) |
|
644 | - $classes[] = 'current-' . $active_object . '-parent'; |
|
657 | + if ( in_array( $parent_item->object_id, $active_parent_object_ids ) ) { |
|
658 | + $classes[] = 'current-' . $active_object . '-parent'; |
|
659 | + } |
|
645 | 660 | |
646 | 661 | if ( 'post_type' == $parent_item->type && 'page' == $parent_item->object ) { |
647 | 662 | // Back compat classes for pages to match wp_page_menu() |
648 | - if ( in_array('current-menu-parent', $classes) ) |
|
649 | - $classes[] = 'current_page_parent'; |
|
650 | - if ( in_array('current-menu-ancestor', $classes) ) |
|
651 | - $classes[] = 'current_page_ancestor'; |
|
663 | + if ( in_array('current-menu-parent', $classes) ) { |
|
664 | + $classes[] = 'current_page_parent'; |
|
665 | + } |
|
666 | + if ( in_array('current-menu-ancestor', $classes) ) { |
|
667 | + $classes[] = 'current_page_ancestor'; |
|
668 | + } |
|
652 | 669 | } |
653 | 670 | |
654 | 671 | $menu_items[$key]->classes = array_unique( $classes ); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @since 3.0.0 |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - public $tree_type = array( 'post_type', 'taxonomy', 'custom' ); |
|
24 | + public $tree_type = array('post_type', 'taxonomy', 'custom'); |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Database fields to use. |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @todo Decouple this. |
32 | 32 | * @var array |
33 | 33 | */ |
34 | - public $db_fields = array( 'parent' => 'menu_item_parent', 'id' => 'db_id' ); |
|
34 | + public $db_fields = array('parent' => 'menu_item_parent', 'id' => 'db_id'); |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Starts the list before the elements are added. |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param int $depth Depth of menu item. Used for padding. |
45 | 45 | * @param array $args An array of arguments. @see wp_nav_menu() |
46 | 46 | */ |
47 | - public function start_lvl( &$output, $depth = 0, $args = array() ) { |
|
47 | + public function start_lvl(&$output, $depth = 0, $args = array()) { |
|
48 | 48 | $indent = str_repeat("\t", $depth); |
49 | 49 | $output .= "\n$indent<ul class=\"sub-menu\">\n"; |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param int $depth Depth of menu item. Used for padding. |
61 | 61 | * @param array $args An array of arguments. @see wp_nav_menu() |
62 | 62 | */ |
63 | - public function end_lvl( &$output, $depth = 0, $args = array() ) { |
|
63 | + public function end_lvl(&$output, $depth = 0, $args = array()) { |
|
64 | 64 | $indent = str_repeat("\t", $depth); |
65 | 65 | $output .= "$indent</ul>\n"; |
66 | 66 | } |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | * @param array $args An array of arguments. @see wp_nav_menu() |
80 | 80 | * @param int $id Current item ID. |
81 | 81 | */ |
82 | - public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { |
|
83 | - $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; |
|
82 | + public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { |
|
83 | + $indent = ($depth) ? str_repeat("\t", $depth) : ''; |
|
84 | 84 | |
85 | - $classes = empty( $item->classes ) ? array() : (array) $item->classes; |
|
86 | - $classes[] = 'menu-item-' . $item->ID; |
|
85 | + $classes = empty($item->classes) ? array() : (array) $item->classes; |
|
86 | + $classes[] = 'menu-item-'.$item->ID; |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * Filter the arguments for a single nav menu item. |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param object $item Menu item data object. |
95 | 95 | * @param int $depth Depth of menu item. Used for padding. |
96 | 96 | */ |
97 | - $args = apply_filters( 'nav_menu_item_args', $args, $item, $depth ); |
|
97 | + $args = apply_filters('nav_menu_item_args', $args, $item, $depth); |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Filter the CSS class(es) applied to a menu item's list item element. |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | * @param array $args An array of {@see wp_nav_menu()} arguments. |
108 | 108 | * @param int $depth Depth of menu item. Used for padding. |
109 | 109 | */ |
110 | - $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) ); |
|
111 | - $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
|
110 | + $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth)); |
|
111 | + $class_names = $class_names ? ' class="'.esc_attr($class_names).'"' : ''; |
|
112 | 112 | |
113 | 113 | /** |
114 | 114 | * Filter the ID applied to a menu item's list item element. |
@@ -121,16 +121,16 @@ discard block |
||
121 | 121 | * @param array $args An array of {@see wp_nav_menu()} arguments. |
122 | 122 | * @param int $depth Depth of menu item. Used for padding. |
123 | 123 | */ |
124 | - $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth ); |
|
125 | - $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; |
|
124 | + $id = apply_filters('nav_menu_item_id', 'menu-item-'.$item->ID, $item, $args, $depth); |
|
125 | + $id = $id ? ' id="'.esc_attr($id).'"' : ''; |
|
126 | 126 | |
127 | - $output .= $indent . '<li' . $id . $class_names .'>'; |
|
127 | + $output .= $indent.'<li'.$id.$class_names.'>'; |
|
128 | 128 | |
129 | 129 | $atts = array(); |
130 | - $atts['title'] = ! empty( $item->attr_title ) ? $item->attr_title : ''; |
|
131 | - $atts['target'] = ! empty( $item->target ) ? $item->target : ''; |
|
132 | - $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; |
|
133 | - $atts['href'] = ! empty( $item->url ) ? $item->url : ''; |
|
130 | + $atts['title'] = ! empty($item->attr_title) ? $item->attr_title : ''; |
|
131 | + $atts['target'] = ! empty($item->target) ? $item->target : ''; |
|
132 | + $atts['rel'] = ! empty($item->xfn) ? $item->xfn : ''; |
|
133 | + $atts['href'] = ! empty($item->url) ? $item->url : ''; |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * Filter the HTML attributes applied to a menu item's anchor element. |
@@ -150,18 +150,18 @@ discard block |
||
150 | 150 | * @param array $args An array of {@see wp_nav_menu()} arguments. |
151 | 151 | * @param int $depth Depth of menu item. Used for padding. |
152 | 152 | */ |
153 | - $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth ); |
|
153 | + $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth); |
|
154 | 154 | |
155 | 155 | $attributes = ''; |
156 | - foreach ( $atts as $attr => $value ) { |
|
157 | - if ( ! empty( $value ) ) { |
|
158 | - $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); |
|
159 | - $attributes .= ' ' . $attr . '="' . $value . '"'; |
|
156 | + foreach ($atts as $attr => $value) { |
|
157 | + if ( ! empty($value)) { |
|
158 | + $value = ('href' === $attr) ? esc_url($value) : esc_attr($value); |
|
159 | + $attributes .= ' '.$attr.'="'.$value.'"'; |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | 163 | /** This filter is documented in wp-includes/post-template.php */ |
164 | - $title = apply_filters( 'the_title', $item->title, $item->ID ); |
|
164 | + $title = apply_filters('the_title', $item->title, $item->ID); |
|
165 | 165 | |
166 | 166 | /** |
167 | 167 | * Filter a menu item's title. |
@@ -173,11 +173,11 @@ discard block |
||
173 | 173 | * @param array $args An array of {@see wp_nav_menu()} arguments. |
174 | 174 | * @param int $depth Depth of menu item. Used for padding. |
175 | 175 | */ |
176 | - $title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth ); |
|
176 | + $title = apply_filters('nav_menu_item_title', $title, $item, $args, $depth); |
|
177 | 177 | |
178 | 178 | $item_output = $args->before; |
179 | - $item_output .= '<a'. $attributes .'>'; |
|
180 | - $item_output .= $args->link_before . $title . $args->link_after; |
|
179 | + $item_output .= '<a'.$attributes.'>'; |
|
180 | + $item_output .= $args->link_before.$title.$args->link_after; |
|
181 | 181 | $item_output .= '</a>'; |
182 | 182 | $item_output .= $args->after; |
183 | 183 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param int $depth Depth of menu item. Used for padding. |
196 | 196 | * @param array $args An array of {@see wp_nav_menu()} arguments. |
197 | 197 | */ |
198 | - $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); |
|
198 | + $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @param int $depth Depth of page. Not Used. |
211 | 211 | * @param array $args An array of arguments. @see wp_nav_menu() |
212 | 212 | */ |
213 | - public function end_el( &$output, $item, $depth = 0, $args = array() ) { |
|
213 | + public function end_el(&$output, $item, $depth = 0, $args = array()) { |
|
214 | 214 | $output .= "</li>\n"; |
215 | 215 | } |
216 | 216 | |
@@ -249,14 +249,14 @@ discard block |
||
249 | 249 | * } |
250 | 250 | * @return object|false|void Menu output if $echo is false, false if there are no items or no menu was found. |
251 | 251 | */ |
252 | -function wp_nav_menu( $args = array() ) { |
|
252 | +function wp_nav_menu($args = array()) { |
|
253 | 253 | static $menu_id_slugs = array(); |
254 | 254 | |
255 | - $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', |
|
255 | + $defaults = array('menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', |
|
256 | 256 | 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', |
257 | - 'depth' => 0, 'walker' => '', 'theme_location' => '' ); |
|
257 | + 'depth' => 0, 'walker' => '', 'theme_location' => ''); |
|
258 | 258 | |
259 | - $args = wp_parse_args( $args, $defaults ); |
|
259 | + $args = wp_parse_args($args, $defaults); |
|
260 | 260 | /** |
261 | 261 | * Filter the arguments used to display a navigation menu. |
262 | 262 | * |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * |
267 | 267 | * @param array $args Array of wp_nav_menu() arguments. |
268 | 268 | */ |
269 | - $args = apply_filters( 'wp_nav_menu_args', $args ); |
|
269 | + $args = apply_filters('wp_nav_menu_args', $args); |
|
270 | 270 | $args = (object) $args; |
271 | 271 | |
272 | 272 | /** |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | * @param string|null $output Nav menu output to short-circuit with. Default null. |
284 | 284 | * @param object $args An object containing wp_nav_menu() arguments. |
285 | 285 | */ |
286 | - $nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args ); |
|
286 | + $nav_menu = apply_filters('pre_wp_nav_menu', null, $args); |
|
287 | 287 | |
288 | - if ( null !== $nav_menu ) { |
|
289 | - if ( $args->echo ) { |
|
288 | + if (null !== $nav_menu) { |
|
289 | + if ($args->echo) { |
|
290 | 290 | echo $nav_menu; |
291 | 291 | return; |
292 | 292 | } |
@@ -295,30 +295,30 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | // Get the nav menu based on the requested menu |
298 | - $menu = wp_get_nav_menu_object( $args->menu ); |
|
298 | + $menu = wp_get_nav_menu_object($args->menu); |
|
299 | 299 | |
300 | 300 | // Get the nav menu based on the theme_location |
301 | - if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) |
|
302 | - $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); |
|
301 | + if ( ! $menu && $args->theme_location && ($locations = get_nav_menu_locations()) && isset($locations[$args->theme_location])) |
|
302 | + $menu = wp_get_nav_menu_object($locations[$args->theme_location]); |
|
303 | 303 | |
304 | 304 | // get the first menu that has items if we still can't find a menu |
305 | - if ( ! $menu && !$args->theme_location ) { |
|
305 | + if ( ! $menu && ! $args->theme_location) { |
|
306 | 306 | $menus = wp_get_nav_menus(); |
307 | - foreach ( $menus as $menu_maybe ) { |
|
308 | - if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) { |
|
307 | + foreach ($menus as $menu_maybe) { |
|
308 | + if ($menu_items = wp_get_nav_menu_items($menu_maybe->term_id, array('update_post_term_cache' => false))) { |
|
309 | 309 | $menu = $menu_maybe; |
310 | 310 | break; |
311 | 311 | } |
312 | 312 | } |
313 | 313 | } |
314 | 314 | |
315 | - if ( empty( $args->menu ) ) { |
|
315 | + if (empty($args->menu)) { |
|
316 | 316 | $args->menu = $menu; |
317 | 317 | } |
318 | 318 | |
319 | 319 | // If the menu exists, get its items. |
320 | - if ( $menu && ! is_wp_error($menu) && !isset($menu_items) ) |
|
321 | - $menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) ); |
|
320 | + if ($menu && ! is_wp_error($menu) && ! isset($menu_items)) |
|
321 | + $menu_items = wp_get_nav_menu_items($menu->term_id, array('update_post_term_cache' => false)); |
|
322 | 322 | |
323 | 323 | /* |
324 | 324 | * If no menu was found: |
@@ -328,17 +328,17 @@ discard block |
||
328 | 328 | * - Fall back, but only if no theme location was specified. |
329 | 329 | * - Otherwise, bail. |
330 | 330 | */ |
331 | - if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) ) |
|
332 | - && isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) ) |
|
333 | - return call_user_func( $args->fallback_cb, (array) $args ); |
|
331 | + if (( ! $menu || is_wp_error($menu) || (isset($menu_items) && empty($menu_items) && ! $args->theme_location)) |
|
332 | + && isset($args->fallback_cb) && $args->fallback_cb && is_callable($args->fallback_cb)) |
|
333 | + return call_user_func($args->fallback_cb, (array) $args); |
|
334 | 334 | |
335 | - if ( ! $menu || is_wp_error( $menu ) ) |
|
335 | + if ( ! $menu || is_wp_error($menu)) |
|
336 | 336 | return false; |
337 | 337 | |
338 | 338 | $nav_menu = $items = ''; |
339 | 339 | |
340 | 340 | $show_container = false; |
341 | - if ( $args->container ) { |
|
341 | + if ($args->container) { |
|
342 | 342 | /** |
343 | 343 | * Filter the list of HTML tags that are valid for use as menu containers. |
344 | 344 | * |
@@ -347,34 +347,34 @@ discard block |
||
347 | 347 | * @param array $tags The acceptable HTML tags for use as menu containers. |
348 | 348 | * Default is array containing 'div' and 'nav'. |
349 | 349 | */ |
350 | - $allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) ); |
|
351 | - if ( is_string( $args->container ) && in_array( $args->container, $allowed_tags ) ) { |
|
350 | + $allowed_tags = apply_filters('wp_nav_menu_container_allowedtags', array('div', 'nav')); |
|
351 | + if (is_string($args->container) && in_array($args->container, $allowed_tags)) { |
|
352 | 352 | $show_container = true; |
353 | - $class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-'. $menu->slug .'-container"'; |
|
354 | - $id = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : ''; |
|
355 | - $nav_menu .= '<'. $args->container . $id . $class . '>'; |
|
353 | + $class = $args->container_class ? ' class="'.esc_attr($args->container_class).'"' : ' class="menu-'.$menu->slug.'-container"'; |
|
354 | + $id = $args->container_id ? ' id="'.esc_attr($args->container_id).'"' : ''; |
|
355 | + $nav_menu .= '<'.$args->container.$id.$class.'>'; |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | |
359 | 359 | // Set up the $menu_item variables |
360 | - _wp_menu_item_classes_by_context( $menu_items ); |
|
360 | + _wp_menu_item_classes_by_context($menu_items); |
|
361 | 361 | |
362 | 362 | $sorted_menu_items = $menu_items_with_children = array(); |
363 | - foreach ( (array) $menu_items as $menu_item ) { |
|
364 | - $sorted_menu_items[ $menu_item->menu_order ] = $menu_item; |
|
365 | - if ( $menu_item->menu_item_parent ) |
|
366 | - $menu_items_with_children[ $menu_item->menu_item_parent ] = true; |
|
363 | + foreach ((array) $menu_items as $menu_item) { |
|
364 | + $sorted_menu_items[$menu_item->menu_order] = $menu_item; |
|
365 | + if ($menu_item->menu_item_parent) |
|
366 | + $menu_items_with_children[$menu_item->menu_item_parent] = true; |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | // Add the menu-item-has-children class where applicable |
370 | - if ( $menu_items_with_children ) { |
|
371 | - foreach ( $sorted_menu_items as &$menu_item ) { |
|
372 | - if ( isset( $menu_items_with_children[ $menu_item->ID ] ) ) |
|
370 | + if ($menu_items_with_children) { |
|
371 | + foreach ($sorted_menu_items as &$menu_item) { |
|
372 | + if (isset($menu_items_with_children[$menu_item->ID])) |
|
373 | 373 | $menu_item->classes[] = 'menu-item-has-children'; |
374 | 374 | } |
375 | 375 | } |
376 | 376 | |
377 | - unset( $menu_items, $menu_item ); |
|
377 | + unset($menu_items, $menu_item); |
|
378 | 378 | |
379 | 379 | /** |
380 | 380 | * Filter the sorted list of menu item objects before generating the menu's HTML. |
@@ -384,21 +384,21 @@ discard block |
||
384 | 384 | * @param array $sorted_menu_items The menu items, sorted by each menu item's menu order. |
385 | 385 | * @param object $args An object containing wp_nav_menu() arguments. |
386 | 386 | */ |
387 | - $sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args ); |
|
387 | + $sorted_menu_items = apply_filters('wp_nav_menu_objects', $sorted_menu_items, $args); |
|
388 | 388 | |
389 | - $items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args ); |
|
389 | + $items .= walk_nav_menu_tree($sorted_menu_items, $args->depth, $args); |
|
390 | 390 | unset($sorted_menu_items); |
391 | 391 | |
392 | 392 | // Attributes |
393 | - if ( ! empty( $args->menu_id ) ) { |
|
393 | + if ( ! empty($args->menu_id)) { |
|
394 | 394 | $wrap_id = $args->menu_id; |
395 | 395 | } else { |
396 | - $wrap_id = 'menu-' . $menu->slug; |
|
397 | - while ( in_array( $wrap_id, $menu_id_slugs ) ) { |
|
398 | - if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) |
|
399 | - $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id ); |
|
396 | + $wrap_id = 'menu-'.$menu->slug; |
|
397 | + while (in_array($wrap_id, $menu_id_slugs)) { |
|
398 | + if (preg_match('#-(\d+)$#', $wrap_id, $matches)) |
|
399 | + $wrap_id = preg_replace('#-(\d+)$#', '-'.++$matches[1], $wrap_id); |
|
400 | 400 | else |
401 | - $wrap_id = $wrap_id . '-1'; |
|
401 | + $wrap_id = $wrap_id.'-1'; |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | $menu_id_slugs[] = $wrap_id; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @param string $items The HTML list content for the menu items. |
416 | 416 | * @param object $args An object containing wp_nav_menu() arguments. |
417 | 417 | */ |
418 | - $items = apply_filters( 'wp_nav_menu_items', $items, $args ); |
|
418 | + $items = apply_filters('wp_nav_menu_items', $items, $args); |
|
419 | 419 | /** |
420 | 420 | * Filter the HTML list content for a specific navigation menu. |
421 | 421 | * |
@@ -426,17 +426,17 @@ discard block |
||
426 | 426 | * @param string $items The HTML list content for the menu items. |
427 | 427 | * @param object $args An object containing wp_nav_menu() arguments. |
428 | 428 | */ |
429 | - $items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args ); |
|
429 | + $items = apply_filters("wp_nav_menu_{$menu->slug}_items", $items, $args); |
|
430 | 430 | |
431 | 431 | // Don't print any markup if there are no items at this point. |
432 | - if ( empty( $items ) ) |
|
432 | + if (empty($items)) |
|
433 | 433 | return false; |
434 | 434 | |
435 | - $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items ); |
|
436 | - unset( $items ); |
|
435 | + $nav_menu .= sprintf($args->items_wrap, esc_attr($wrap_id), esc_attr($wrap_class), $items); |
|
436 | + unset($items); |
|
437 | 437 | |
438 | - if ( $show_container ) |
|
439 | - $nav_menu .= '</' . $args->container . '>'; |
|
438 | + if ($show_container) |
|
439 | + $nav_menu .= '</'.$args->container.'>'; |
|
440 | 440 | |
441 | 441 | /** |
442 | 442 | * Filter the HTML content for navigation menus. |
@@ -448,9 +448,9 @@ discard block |
||
448 | 448 | * @param string $nav_menu The HTML content for the navigation menu. |
449 | 449 | * @param object $args An object containing wp_nav_menu() arguments. |
450 | 450 | */ |
451 | - $nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args ); |
|
451 | + $nav_menu = apply_filters('wp_nav_menu', $nav_menu, $args); |
|
452 | 452 | |
453 | - if ( $args->echo ) |
|
453 | + if ($args->echo) |
|
454 | 454 | echo $nav_menu; |
455 | 455 | else |
456 | 456 | return $nav_menu; |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | * |
468 | 468 | * @param array $menu_items The current menu item objects to which to add the class property information. |
469 | 469 | */ |
470 | -function _wp_menu_item_classes_by_context( &$menu_items ) { |
|
470 | +function _wp_menu_item_classes_by_context(&$menu_items) { |
|
471 | 471 | global $wp_query, $wp_rewrite; |
472 | 472 | |
473 | 473 | $queried_object = $wp_query->get_queried_object(); |
@@ -479,71 +479,71 @@ discard block |
||
479 | 479 | $active_parent_object_ids = array(); |
480 | 480 | $possible_taxonomy_ancestors = array(); |
481 | 481 | $possible_object_parents = array(); |
482 | - $home_page_id = (int) get_option( 'page_for_posts' ); |
|
483 | - |
|
484 | - if ( $wp_query->is_singular && ! empty( $queried_object->post_type ) && ! is_post_type_hierarchical( $queried_object->post_type ) ) { |
|
485 | - foreach ( (array) get_object_taxonomies( $queried_object->post_type ) as $taxonomy ) { |
|
486 | - if ( is_taxonomy_hierarchical( $taxonomy ) ) { |
|
487 | - $term_hierarchy = _get_term_hierarchy( $taxonomy ); |
|
488 | - $terms = wp_get_object_terms( $queried_object_id, $taxonomy, array( 'fields' => 'ids' ) ); |
|
489 | - if ( is_array( $terms ) ) { |
|
490 | - $possible_object_parents = array_merge( $possible_object_parents, $terms ); |
|
482 | + $home_page_id = (int) get_option('page_for_posts'); |
|
483 | + |
|
484 | + if ($wp_query->is_singular && ! empty($queried_object->post_type) && ! is_post_type_hierarchical($queried_object->post_type)) { |
|
485 | + foreach ((array) get_object_taxonomies($queried_object->post_type) as $taxonomy) { |
|
486 | + if (is_taxonomy_hierarchical($taxonomy)) { |
|
487 | + $term_hierarchy = _get_term_hierarchy($taxonomy); |
|
488 | + $terms = wp_get_object_terms($queried_object_id, $taxonomy, array('fields' => 'ids')); |
|
489 | + if (is_array($terms)) { |
|
490 | + $possible_object_parents = array_merge($possible_object_parents, $terms); |
|
491 | 491 | $term_to_ancestor = array(); |
492 | - foreach ( (array) $term_hierarchy as $anc => $descs ) { |
|
493 | - foreach ( (array) $descs as $desc ) |
|
494 | - $term_to_ancestor[ $desc ] = $anc; |
|
492 | + foreach ((array) $term_hierarchy as $anc => $descs) { |
|
493 | + foreach ((array) $descs as $desc) |
|
494 | + $term_to_ancestor[$desc] = $anc; |
|
495 | 495 | } |
496 | 496 | |
497 | - foreach ( $terms as $desc ) { |
|
497 | + foreach ($terms as $desc) { |
|
498 | 498 | do { |
499 | - $possible_taxonomy_ancestors[ $taxonomy ][] = $desc; |
|
500 | - if ( isset( $term_to_ancestor[ $desc ] ) ) { |
|
501 | - $_desc = $term_to_ancestor[ $desc ]; |
|
502 | - unset( $term_to_ancestor[ $desc ] ); |
|
499 | + $possible_taxonomy_ancestors[$taxonomy][] = $desc; |
|
500 | + if (isset($term_to_ancestor[$desc])) { |
|
501 | + $_desc = $term_to_ancestor[$desc]; |
|
502 | + unset($term_to_ancestor[$desc]); |
|
503 | 503 | $desc = $_desc; |
504 | 504 | } else { |
505 | 505 | $desc = 0; |
506 | 506 | } |
507 | - } while ( ! empty( $desc ) ); |
|
507 | + } while ( ! empty($desc)); |
|
508 | 508 | } |
509 | 509 | } |
510 | 510 | } |
511 | 511 | } |
512 | - } elseif ( ! empty( $queried_object->taxonomy ) && is_taxonomy_hierarchical( $queried_object->taxonomy ) ) { |
|
513 | - $term_hierarchy = _get_term_hierarchy( $queried_object->taxonomy ); |
|
512 | + } elseif ( ! empty($queried_object->taxonomy) && is_taxonomy_hierarchical($queried_object->taxonomy)) { |
|
513 | + $term_hierarchy = _get_term_hierarchy($queried_object->taxonomy); |
|
514 | 514 | $term_to_ancestor = array(); |
515 | - foreach ( (array) $term_hierarchy as $anc => $descs ) { |
|
516 | - foreach ( (array) $descs as $desc ) |
|
517 | - $term_to_ancestor[ $desc ] = $anc; |
|
515 | + foreach ((array) $term_hierarchy as $anc => $descs) { |
|
516 | + foreach ((array) $descs as $desc) |
|
517 | + $term_to_ancestor[$desc] = $anc; |
|
518 | 518 | } |
519 | 519 | $desc = $queried_object->term_id; |
520 | 520 | do { |
521 | - $possible_taxonomy_ancestors[ $queried_object->taxonomy ][] = $desc; |
|
522 | - if ( isset( $term_to_ancestor[ $desc ] ) ) { |
|
523 | - $_desc = $term_to_ancestor[ $desc ]; |
|
524 | - unset( $term_to_ancestor[ $desc ] ); |
|
521 | + $possible_taxonomy_ancestors[$queried_object->taxonomy][] = $desc; |
|
522 | + if (isset($term_to_ancestor[$desc])) { |
|
523 | + $_desc = $term_to_ancestor[$desc]; |
|
524 | + unset($term_to_ancestor[$desc]); |
|
525 | 525 | $desc = $_desc; |
526 | 526 | } else { |
527 | 527 | $desc = 0; |
528 | 528 | } |
529 | - } while ( ! empty( $desc ) ); |
|
529 | + } while ( ! empty($desc)); |
|
530 | 530 | } |
531 | 531 | |
532 | - $possible_object_parents = array_filter( $possible_object_parents ); |
|
532 | + $possible_object_parents = array_filter($possible_object_parents); |
|
533 | 533 | |
534 | 534 | $front_page_url = home_url(); |
535 | 535 | |
536 | - foreach ( (array) $menu_items as $key => $menu_item ) { |
|
536 | + foreach ((array) $menu_items as $key => $menu_item) { |
|
537 | 537 | |
538 | 538 | $menu_items[$key]->current = false; |
539 | 539 | |
540 | 540 | $classes = (array) $menu_item->classes; |
541 | 541 | $classes[] = 'menu-item'; |
542 | - $classes[] = 'menu-item-type-' . $menu_item->type; |
|
543 | - $classes[] = 'menu-item-object-' . $menu_item->object; |
|
542 | + $classes[] = 'menu-item-type-'.$menu_item->type; |
|
543 | + $classes[] = 'menu-item-object-'.$menu_item->object; |
|
544 | 544 | |
545 | 545 | // if the menu item corresponds to a taxonomy term for the currently-queried non-hierarchical post object |
546 | - if ( $wp_query->is_singular && 'taxonomy' == $menu_item->type && in_array( $menu_item->object_id, $possible_object_parents ) ) { |
|
546 | + if ($wp_query->is_singular && 'taxonomy' == $menu_item->type && in_array($menu_item->object_id, $possible_object_parents)) { |
|
547 | 547 | $active_parent_object_ids[] = (int) $menu_item->object_id; |
548 | 548 | $active_parent_item_ids[] = (int) $menu_item->db_id; |
549 | 549 | $active_object = $queried_object->post_type; |
@@ -552,26 +552,26 @@ discard block |
||
552 | 552 | } elseif ( |
553 | 553 | $menu_item->object_id == $queried_object_id && |
554 | 554 | ( |
555 | - ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id == $menu_item->object_id ) || |
|
556 | - ( 'post_type' == $menu_item->type && $wp_query->is_singular ) || |
|
557 | - ( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) && $queried_object->taxonomy == $menu_item->object ) |
|
555 | + ( ! empty($home_page_id) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id == $menu_item->object_id) || |
|
556 | + ('post_type' == $menu_item->type && $wp_query->is_singular) || |
|
557 | + ('taxonomy' == $menu_item->type && ($wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax) && $queried_object->taxonomy == $menu_item->object) |
|
558 | 558 | ) |
559 | 559 | ) { |
560 | 560 | $classes[] = 'current-menu-item'; |
561 | 561 | $menu_items[$key]->current = true; |
562 | 562 | $_anc_id = (int) $menu_item->db_id; |
563 | 563 | |
564 | - while( |
|
565 | - ( $_anc_id = get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) ) && |
|
566 | - ! in_array( $_anc_id, $active_ancestor_item_ids ) |
|
564 | + while ( |
|
565 | + ($_anc_id = get_post_meta($_anc_id, '_menu_item_menu_item_parent', true)) && |
|
566 | + ! in_array($_anc_id, $active_ancestor_item_ids) |
|
567 | 567 | ) { |
568 | 568 | $active_ancestor_item_ids[] = $_anc_id; |
569 | 569 | } |
570 | 570 | |
571 | - if ( 'post_type' == $menu_item->type && 'page' == $menu_item->object ) { |
|
571 | + if ('post_type' == $menu_item->type && 'page' == $menu_item->object) { |
|
572 | 572 | // Back compat classes for pages to match wp_page_menu() |
573 | 573 | $classes[] = 'page_item'; |
574 | - $classes[] = 'page-item-' . $menu_item->object_id; |
|
574 | + $classes[] = 'page-item-'.$menu_item->object_id; |
|
575 | 575 | $classes[] = 'current_page_item'; |
576 | 576 | } |
577 | 577 | $active_parent_item_ids[] = (int) $menu_item->menu_item_parent; |
@@ -581,31 +581,31 @@ discard block |
||
581 | 581 | // if the menu item corresponds to the currently-queried post type archive |
582 | 582 | } elseif ( |
583 | 583 | 'post_type_archive' == $menu_item->type && |
584 | - is_post_type_archive( array( $menu_item->object ) ) |
|
584 | + is_post_type_archive(array($menu_item->object)) |
|
585 | 585 | ) { |
586 | 586 | $classes[] = 'current-menu-item'; |
587 | 587 | $menu_items[$key]->current = true; |
588 | 588 | // if the menu item corresponds to the currently-requested URL |
589 | - } elseif ( 'custom' == $menu_item->object && isset( $_SERVER['HTTP_HOST'] ) ) { |
|
590 | - $_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] ); |
|
591 | - $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current ); |
|
592 | - $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url; |
|
593 | - $item_url = set_url_scheme( untrailingslashit( $raw_item_url ) ); |
|
594 | - $_indexless_current = untrailingslashit( preg_replace( '/' . preg_quote( $wp_rewrite->index, '/' ) . '$/', '', $current_url ) ); |
|
595 | - |
|
596 | - if ( $raw_item_url && in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) { |
|
589 | + } elseif ('custom' == $menu_item->object && isset($_SERVER['HTTP_HOST'])) { |
|
590 | + $_root_relative_current = untrailingslashit($_SERVER['REQUEST_URI']); |
|
591 | + $current_url = set_url_scheme('http://'.$_SERVER['HTTP_HOST'].$_root_relative_current); |
|
592 | + $raw_item_url = strpos($menu_item->url, '#') ? substr($menu_item->url, 0, strpos($menu_item->url, '#')) : $menu_item->url; |
|
593 | + $item_url = set_url_scheme(untrailingslashit($raw_item_url)); |
|
594 | + $_indexless_current = untrailingslashit(preg_replace('/'.preg_quote($wp_rewrite->index, '/').'$/', '', $current_url)); |
|
595 | + |
|
596 | + if ($raw_item_url && in_array($item_url, array($current_url, $_indexless_current, $_root_relative_current))) { |
|
597 | 597 | $classes[] = 'current-menu-item'; |
598 | 598 | $menu_items[$key]->current = true; |
599 | 599 | $_anc_id = (int) $menu_item->db_id; |
600 | 600 | |
601 | - while( |
|
602 | - ( $_anc_id = get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) ) && |
|
603 | - ! in_array( $_anc_id, $active_ancestor_item_ids ) |
|
601 | + while ( |
|
602 | + ($_anc_id = get_post_meta($_anc_id, '_menu_item_menu_item_parent', true)) && |
|
603 | + ! in_array($_anc_id, $active_ancestor_item_ids) |
|
604 | 604 | ) { |
605 | 605 | $active_ancestor_item_ids[] = $_anc_id; |
606 | 606 | } |
607 | 607 | |
608 | - if ( in_array( home_url(), array( untrailingslashit( $current_url ), untrailingslashit( $_indexless_current ) ) ) ) { |
|
608 | + if (in_array(home_url(), array(untrailingslashit($current_url), untrailingslashit($_indexless_current)))) { |
|
609 | 609 | // Back compat for home link to match wp_page_menu() |
610 | 610 | $classes[] = 'current_page_item'; |
611 | 611 | } |
@@ -614,77 +614,77 @@ discard block |
||
614 | 614 | $active_object = $menu_item->object; |
615 | 615 | |
616 | 616 | // give front page item current-menu-item class when extra query arguments involved |
617 | - } elseif ( $item_url == $front_page_url && is_front_page() ) { |
|
617 | + } elseif ($item_url == $front_page_url && is_front_page()) { |
|
618 | 618 | $classes[] = 'current-menu-item'; |
619 | 619 | } |
620 | 620 | |
621 | - if ( untrailingslashit($item_url) == home_url() ) |
|
621 | + if (untrailingslashit($item_url) == home_url()) |
|
622 | 622 | $classes[] = 'menu-item-home'; |
623 | 623 | } |
624 | 624 | |
625 | 625 | // back-compat with wp_page_menu: add "current_page_parent" to static home page link for any non-page query |
626 | - if ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id ) |
|
626 | + if ( ! empty($home_page_id) && 'post_type' == $menu_item->type && empty($wp_query->is_page) && $home_page_id == $menu_item->object_id) |
|
627 | 627 | $classes[] = 'current_page_parent'; |
628 | 628 | |
629 | - $menu_items[$key]->classes = array_unique( $classes ); |
|
629 | + $menu_items[$key]->classes = array_unique($classes); |
|
630 | 630 | } |
631 | - $active_ancestor_item_ids = array_filter( array_unique( $active_ancestor_item_ids ) ); |
|
632 | - $active_parent_item_ids = array_filter( array_unique( $active_parent_item_ids ) ); |
|
633 | - $active_parent_object_ids = array_filter( array_unique( $active_parent_object_ids ) ); |
|
631 | + $active_ancestor_item_ids = array_filter(array_unique($active_ancestor_item_ids)); |
|
632 | + $active_parent_item_ids = array_filter(array_unique($active_parent_item_ids)); |
|
633 | + $active_parent_object_ids = array_filter(array_unique($active_parent_object_ids)); |
|
634 | 634 | |
635 | 635 | // set parent's class |
636 | - foreach ( (array) $menu_items as $key => $parent_item ) { |
|
636 | + foreach ((array) $menu_items as $key => $parent_item) { |
|
637 | 637 | $classes = (array) $parent_item->classes; |
638 | 638 | $menu_items[$key]->current_item_ancestor = false; |
639 | 639 | $menu_items[$key]->current_item_parent = false; |
640 | 640 | |
641 | 641 | if ( |
642 | - isset( $parent_item->type ) && |
|
642 | + isset($parent_item->type) && |
|
643 | 643 | ( |
644 | 644 | // ancestral post object |
645 | 645 | ( |
646 | 646 | 'post_type' == $parent_item->type && |
647 | - ! empty( $queried_object->post_type ) && |
|
648 | - is_post_type_hierarchical( $queried_object->post_type ) && |
|
649 | - in_array( $parent_item->object_id, $queried_object->ancestors ) && |
|
647 | + ! empty($queried_object->post_type) && |
|
648 | + is_post_type_hierarchical($queried_object->post_type) && |
|
649 | + in_array($parent_item->object_id, $queried_object->ancestors) && |
|
650 | 650 | $parent_item->object != $queried_object->ID |
651 | 651 | ) || |
652 | 652 | |
653 | 653 | // ancestral term |
654 | 654 | ( |
655 | 655 | 'taxonomy' == $parent_item->type && |
656 | - isset( $possible_taxonomy_ancestors[ $parent_item->object ] ) && |
|
657 | - in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] ) && |
|
656 | + isset($possible_taxonomy_ancestors[$parent_item->object]) && |
|
657 | + in_array($parent_item->object_id, $possible_taxonomy_ancestors[$parent_item->object]) && |
|
658 | 658 | ( |
659 | - ! isset( $queried_object->term_id ) || |
|
659 | + ! isset($queried_object->term_id) || |
|
660 | 660 | $parent_item->object_id != $queried_object->term_id |
661 | 661 | ) |
662 | 662 | ) |
663 | 663 | ) |
664 | 664 | ) { |
665 | - $classes[] = empty( $queried_object->taxonomy ) ? 'current-' . $queried_object->post_type . '-ancestor' : 'current-' . $queried_object->taxonomy . '-ancestor'; |
|
665 | + $classes[] = empty($queried_object->taxonomy) ? 'current-'.$queried_object->post_type.'-ancestor' : 'current-'.$queried_object->taxonomy.'-ancestor'; |
|
666 | 666 | } |
667 | 667 | |
668 | - if ( in_array( intval( $parent_item->db_id ), $active_ancestor_item_ids ) ) { |
|
668 | + if (in_array(intval($parent_item->db_id), $active_ancestor_item_ids)) { |
|
669 | 669 | $classes[] = 'current-menu-ancestor'; |
670 | 670 | $menu_items[$key]->current_item_ancestor = true; |
671 | 671 | } |
672 | - if ( in_array( $parent_item->db_id, $active_parent_item_ids ) ) { |
|
672 | + if (in_array($parent_item->db_id, $active_parent_item_ids)) { |
|
673 | 673 | $classes[] = 'current-menu-parent'; |
674 | 674 | $menu_items[$key]->current_item_parent = true; |
675 | 675 | } |
676 | - if ( in_array( $parent_item->object_id, $active_parent_object_ids ) ) |
|
677 | - $classes[] = 'current-' . $active_object . '-parent'; |
|
676 | + if (in_array($parent_item->object_id, $active_parent_object_ids)) |
|
677 | + $classes[] = 'current-'.$active_object.'-parent'; |
|
678 | 678 | |
679 | - if ( 'post_type' == $parent_item->type && 'page' == $parent_item->object ) { |
|
679 | + if ('post_type' == $parent_item->type && 'page' == $parent_item->object) { |
|
680 | 680 | // Back compat classes for pages to match wp_page_menu() |
681 | - if ( in_array('current-menu-parent', $classes) ) |
|
681 | + if (in_array('current-menu-parent', $classes)) |
|
682 | 682 | $classes[] = 'current_page_parent'; |
683 | - if ( in_array('current-menu-ancestor', $classes) ) |
|
683 | + if (in_array('current-menu-ancestor', $classes)) |
|
684 | 684 | $classes[] = 'current_page_ancestor'; |
685 | 685 | } |
686 | 686 | |
687 | - $menu_items[$key]->classes = array_unique( $classes ); |
|
687 | + $menu_items[$key]->classes = array_unique($classes); |
|
688 | 688 | } |
689 | 689 | } |
690 | 690 | |
@@ -699,11 +699,11 @@ discard block |
||
699 | 699 | * @param object $r |
700 | 700 | * @return string |
701 | 701 | */ |
702 | -function walk_nav_menu_tree( $items, $depth, $r ) { |
|
703 | - $walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker; |
|
704 | - $args = array( $items, $depth, $r ); |
|
702 | +function walk_nav_menu_tree($items, $depth, $r) { |
|
703 | + $walker = (empty($r->walker)) ? new Walker_Nav_Menu : $r->walker; |
|
704 | + $args = array($items, $depth, $r); |
|
705 | 705 | |
706 | - return call_user_func_array( array( $walker, 'walk' ), $args ); |
|
706 | + return call_user_func_array(array($walker, 'walk'), $args); |
|
707 | 707 | } |
708 | 708 | |
709 | 709 | /** |
@@ -717,9 +717,9 @@ discard block |
||
717 | 717 | * @param object $item |
718 | 718 | * @return string |
719 | 719 | */ |
720 | -function _nav_menu_item_id_use_once( $id, $item ) { |
|
720 | +function _nav_menu_item_id_use_once($id, $item) { |
|
721 | 721 | static $_used_ids = array(); |
722 | - if ( in_array( $item->ID, $_used_ids ) ) { |
|
722 | + if (in_array($item->ID, $_used_ids)) { |
|
723 | 723 | return ''; |
724 | 724 | } |
725 | 725 | $_used_ids[] = $item->ID; |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Deprecated. Use rss.php instead. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - */ |
|
3 | + * Deprecated. Use rss.php instead. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | _deprecated_file( basename(__FILE__), '2.1', WPINC . '/rss.php' ); |
9 | 9 | require_once( ABSPATH . WPINC . '/rss.php' ); |
@@ -5,5 +5,5 @@ |
||
5 | 5 | * @package WordPress |
6 | 6 | */ |
7 | 7 | |
8 | -_deprecated_file( basename(__FILE__), '2.1', WPINC . '/rss.php' ); |
|
9 | -require_once( ABSPATH . WPINC . '/rss.php' ); |
|
8 | +_deprecated_file(basename(__FILE__), '2.1', WPINC.'/rss.php'); |
|
9 | +require_once(ABSPATH.WPINC.'/rss.php'); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Date and Time Locale object |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage i18n |
|
7 | - */ |
|
3 | + * Date and Time Locale object |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage i18n |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Class that loads the calendar locale. |
@@ -179,11 +179,13 @@ |
||
179 | 179 | $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; |
180 | 180 | |
181 | 181 | // Set text direction. |
182 | - if ( isset( $GLOBALS['text_direction'] ) ) |
|
183 | - $this->text_direction = $GLOBALS['text_direction']; |
|
182 | + if ( isset( $GLOBALS['text_direction'] ) ) { |
|
183 | + $this->text_direction = $GLOBALS['text_direction']; |
|
184 | + } |
|
184 | 185 | /* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */ |
185 | - elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) |
|
186 | - $this->text_direction = 'rtl'; |
|
186 | + elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) { |
|
187 | + $this->text_direction = 'rtl'; |
|
188 | + } |
|
187 | 189 | |
188 | 190 | if ( 'rtl' === $this->text_direction && strpos( $GLOBALS['wp_version'], '-src' ) ) { |
189 | 191 | $this->text_direction = 'ltr'; |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | $this->weekday[6] = /* translators: weekday */ __('Saturday'); |
119 | 119 | |
120 | 120 | // The first letter of each day. |
121 | - $this->weekday_initial[ __( 'Sunday' ) ] = /* translators: one-letter abbreviation of the weekday */ _x( 'S', 'Sunday initial' ); |
|
122 | - $this->weekday_initial[ __( 'Monday' ) ] = /* translators: one-letter abbreviation of the weekday */ _x( 'M', 'Monday initial' ); |
|
123 | - $this->weekday_initial[ __( 'Tuesday' ) ] = /* translators: one-letter abbreviation of the weekday */ _x( 'T', 'Tuesday initial' ); |
|
124 | - $this->weekday_initial[ __( 'Wednesday' ) ] = /* translators: one-letter abbreviation of the weekday */ _x( 'W', 'Wednesday initial' ); |
|
125 | - $this->weekday_initial[ __( 'Thursday' ) ] = /* translators: one-letter abbreviation of the weekday */ _x( 'T', 'Thursday initial' ); |
|
126 | - $this->weekday_initial[ __( 'Friday' ) ] = /* translators: one-letter abbreviation of the weekday */ _x( 'F', 'Friday initial' ); |
|
127 | - $this->weekday_initial[ __( 'Saturday' ) ] = /* translators: one-letter abbreviation of the weekday */ _x( 'S', 'Saturday initial' ); |
|
121 | + $this->weekday_initial[__('Sunday')] = /* translators: one-letter abbreviation of the weekday */ _x('S', 'Sunday initial'); |
|
122 | + $this->weekday_initial[__('Monday')] = /* translators: one-letter abbreviation of the weekday */ _x('M', 'Monday initial'); |
|
123 | + $this->weekday_initial[__('Tuesday')] = /* translators: one-letter abbreviation of the weekday */ _x('T', 'Tuesday initial'); |
|
124 | + $this->weekday_initial[__('Wednesday')] = /* translators: one-letter abbreviation of the weekday */ _x('W', 'Wednesday initial'); |
|
125 | + $this->weekday_initial[__('Thursday')] = /* translators: one-letter abbreviation of the weekday */ _x('T', 'Thursday initial'); |
|
126 | + $this->weekday_initial[__('Friday')] = /* translators: one-letter abbreviation of the weekday */ _x('F', 'Friday initial'); |
|
127 | + $this->weekday_initial[__('Saturday')] = /* translators: one-letter abbreviation of the weekday */ _x('S', 'Saturday initial'); |
|
128 | 128 | |
129 | 129 | // Abbreviations for each day. |
130 | 130 | $this->weekday_abbrev[__('Sunday')] = /* translators: three-letter abbreviation of the weekday */ __('Sun'); |
@@ -136,46 +136,46 @@ discard block |
||
136 | 136 | $this->weekday_abbrev[__('Saturday')] = /* translators: three-letter abbreviation of the weekday */ __('Sat'); |
137 | 137 | |
138 | 138 | // The Months |
139 | - $this->month['01'] = /* translators: month name */ __( 'January' ); |
|
140 | - $this->month['02'] = /* translators: month name */ __( 'February' ); |
|
141 | - $this->month['03'] = /* translators: month name */ __( 'March' ); |
|
142 | - $this->month['04'] = /* translators: month name */ __( 'April' ); |
|
143 | - $this->month['05'] = /* translators: month name */ __( 'May' ); |
|
144 | - $this->month['06'] = /* translators: month name */ __( 'June' ); |
|
145 | - $this->month['07'] = /* translators: month name */ __( 'July' ); |
|
146 | - $this->month['08'] = /* translators: month name */ __( 'August' ); |
|
147 | - $this->month['09'] = /* translators: month name */ __( 'September' ); |
|
148 | - $this->month['10'] = /* translators: month name */ __( 'October' ); |
|
149 | - $this->month['11'] = /* translators: month name */ __( 'November' ); |
|
150 | - $this->month['12'] = /* translators: month name */ __( 'December' ); |
|
139 | + $this->month['01'] = /* translators: month name */ __('January'); |
|
140 | + $this->month['02'] = /* translators: month name */ __('February'); |
|
141 | + $this->month['03'] = /* translators: month name */ __('March'); |
|
142 | + $this->month['04'] = /* translators: month name */ __('April'); |
|
143 | + $this->month['05'] = /* translators: month name */ __('May'); |
|
144 | + $this->month['06'] = /* translators: month name */ __('June'); |
|
145 | + $this->month['07'] = /* translators: month name */ __('July'); |
|
146 | + $this->month['08'] = /* translators: month name */ __('August'); |
|
147 | + $this->month['09'] = /* translators: month name */ __('September'); |
|
148 | + $this->month['10'] = /* translators: month name */ __('October'); |
|
149 | + $this->month['11'] = /* translators: month name */ __('November'); |
|
150 | + $this->month['12'] = /* translators: month name */ __('December'); |
|
151 | 151 | |
152 | 152 | // The Months, genitive |
153 | - $this->month_genitive['01'] = /* translators: month name, genitive */ _x( 'January', 'genitive' ); |
|
154 | - $this->month_genitive['02'] = /* translators: month name, genitive */ _x( 'February', 'genitive' ); |
|
155 | - $this->month_genitive['03'] = /* translators: month name, genitive */ _x( 'March', 'genitive' ); |
|
156 | - $this->month_genitive['04'] = /* translators: month name, genitive */ _x( 'April', 'genitive' ); |
|
157 | - $this->month_genitive['05'] = /* translators: month name, genitive */ _x( 'May', 'genitive' ); |
|
158 | - $this->month_genitive['06'] = /* translators: month name, genitive */ _x( 'June', 'genitive' ); |
|
159 | - $this->month_genitive['07'] = /* translators: month name, genitive */ _x( 'July', 'genitive' ); |
|
160 | - $this->month_genitive['08'] = /* translators: month name, genitive */ _x( 'August', 'genitive' ); |
|
161 | - $this->month_genitive['09'] = /* translators: month name, genitive */ _x( 'September', 'genitive' ); |
|
162 | - $this->month_genitive['10'] = /* translators: month name, genitive */ _x( 'October', 'genitive' ); |
|
163 | - $this->month_genitive['11'] = /* translators: month name, genitive */ _x( 'November', 'genitive' ); |
|
164 | - $this->month_genitive['12'] = /* translators: month name, genitive */ _x( 'December', 'genitive' ); |
|
153 | + $this->month_genitive['01'] = /* translators: month name, genitive */ _x('January', 'genitive'); |
|
154 | + $this->month_genitive['02'] = /* translators: month name, genitive */ _x('February', 'genitive'); |
|
155 | + $this->month_genitive['03'] = /* translators: month name, genitive */ _x('March', 'genitive'); |
|
156 | + $this->month_genitive['04'] = /* translators: month name, genitive */ _x('April', 'genitive'); |
|
157 | + $this->month_genitive['05'] = /* translators: month name, genitive */ _x('May', 'genitive'); |
|
158 | + $this->month_genitive['06'] = /* translators: month name, genitive */ _x('June', 'genitive'); |
|
159 | + $this->month_genitive['07'] = /* translators: month name, genitive */ _x('July', 'genitive'); |
|
160 | + $this->month_genitive['08'] = /* translators: month name, genitive */ _x('August', 'genitive'); |
|
161 | + $this->month_genitive['09'] = /* translators: month name, genitive */ _x('September', 'genitive'); |
|
162 | + $this->month_genitive['10'] = /* translators: month name, genitive */ _x('October', 'genitive'); |
|
163 | + $this->month_genitive['11'] = /* translators: month name, genitive */ _x('November', 'genitive'); |
|
164 | + $this->month_genitive['12'] = /* translators: month name, genitive */ _x('December', 'genitive'); |
|
165 | 165 | |
166 | 166 | // Abbreviations for each month. |
167 | - $this->month_abbrev[ __( 'January' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Jan', 'January abbreviation' ); |
|
168 | - $this->month_abbrev[ __( 'February' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Feb', 'February abbreviation' ); |
|
169 | - $this->month_abbrev[ __( 'March' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Mar', 'March abbreviation' ); |
|
170 | - $this->month_abbrev[ __( 'April' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Apr', 'April abbreviation' ); |
|
171 | - $this->month_abbrev[ __( 'May' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'May', 'May abbreviation' ); |
|
172 | - $this->month_abbrev[ __( 'June' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Jun', 'June abbreviation' ); |
|
173 | - $this->month_abbrev[ __( 'July' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Jul', 'July abbreviation' ); |
|
174 | - $this->month_abbrev[ __( 'August' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Aug', 'August abbreviation' ); |
|
175 | - $this->month_abbrev[ __( 'September' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Sep', 'September abbreviation' ); |
|
176 | - $this->month_abbrev[ __( 'October' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Oct', 'October abbreviation' ); |
|
177 | - $this->month_abbrev[ __( 'November' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Nov', 'November abbreviation' ); |
|
178 | - $this->month_abbrev[ __( 'December' ) ] = /* translators: three-letter abbreviation of the month */ _x( 'Dec', 'December abbreviation' ); |
|
167 | + $this->month_abbrev[__('January')] = /* translators: three-letter abbreviation of the month */ _x('Jan', 'January abbreviation'); |
|
168 | + $this->month_abbrev[__('February')] = /* translators: three-letter abbreviation of the month */ _x('Feb', 'February abbreviation'); |
|
169 | + $this->month_abbrev[__('March')] = /* translators: three-letter abbreviation of the month */ _x('Mar', 'March abbreviation'); |
|
170 | + $this->month_abbrev[__('April')] = /* translators: three-letter abbreviation of the month */ _x('Apr', 'April abbreviation'); |
|
171 | + $this->month_abbrev[__('May')] = /* translators: three-letter abbreviation of the month */ _x('May', 'May abbreviation'); |
|
172 | + $this->month_abbrev[__('June')] = /* translators: three-letter abbreviation of the month */ _x('Jun', 'June abbreviation'); |
|
173 | + $this->month_abbrev[__('July')] = /* translators: three-letter abbreviation of the month */ _x('Jul', 'July abbreviation'); |
|
174 | + $this->month_abbrev[__('August')] = /* translators: three-letter abbreviation of the month */ _x('Aug', 'August abbreviation'); |
|
175 | + $this->month_abbrev[__('September')] = /* translators: three-letter abbreviation of the month */ _x('Sep', 'September abbreviation'); |
|
176 | + $this->month_abbrev[__('October')] = /* translators: three-letter abbreviation of the month */ _x('Oct', 'October abbreviation'); |
|
177 | + $this->month_abbrev[__('November')] = /* translators: three-letter abbreviation of the month */ _x('Nov', 'November abbreviation'); |
|
178 | + $this->month_abbrev[__('December')] = /* translators: three-letter abbreviation of the month */ _x('Dec', 'December abbreviation'); |
|
179 | 179 | |
180 | 180 | // The Meridiems |
181 | 181 | $this->meridiem['am'] = __('am'); |
@@ -187,33 +187,33 @@ discard block |
||
187 | 187 | // See http://php.net/number_format |
188 | 188 | |
189 | 189 | /* translators: $thousands_sep argument for http://php.net/number_format, default is , */ |
190 | - $thousands_sep = __( 'number_format_thousands_sep' ); |
|
190 | + $thousands_sep = __('number_format_thousands_sep'); |
|
191 | 191 | |
192 | - if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) { |
|
192 | + if (version_compare(PHP_VERSION, '5.4', '>=')) { |
|
193 | 193 | // Replace space with a non-breaking space to avoid wrapping. |
194 | - $thousands_sep = str_replace( ' ', ' ', $thousands_sep ); |
|
194 | + $thousands_sep = str_replace(' ', ' ', $thousands_sep); |
|
195 | 195 | } else { |
196 | 196 | // PHP < 5.4.0 does not support multiple bytes in thousands separator. |
197 | - $thousands_sep = str_replace( array( ' ', ' ' ), ' ', $thousands_sep ); |
|
197 | + $thousands_sep = str_replace(array(' ', ' '), ' ', $thousands_sep); |
|
198 | 198 | } |
199 | 199 | |
200 | - $this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep; |
|
200 | + $this->number_format['thousands_sep'] = ('number_format_thousands_sep' === $thousands_sep) ? ',' : $thousands_sep; |
|
201 | 201 | |
202 | 202 | /* translators: $dec_point argument for http://php.net/number_format, default is . */ |
203 | - $decimal_point = __( 'number_format_decimal_point' ); |
|
203 | + $decimal_point = __('number_format_decimal_point'); |
|
204 | 204 | |
205 | - $this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point; |
|
205 | + $this->number_format['decimal_point'] = ('number_format_decimal_point' === $decimal_point) ? '.' : $decimal_point; |
|
206 | 206 | |
207 | 207 | // Set text direction. |
208 | - if ( isset( $GLOBALS['text_direction'] ) ) |
|
208 | + if (isset($GLOBALS['text_direction'])) |
|
209 | 209 | $this->text_direction = $GLOBALS['text_direction']; |
210 | 210 | /* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */ |
211 | - elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) |
|
211 | + elseif ('rtl' == _x('ltr', 'text direction')) |
|
212 | 212 | $this->text_direction = 'rtl'; |
213 | 213 | |
214 | - if ( 'rtl' === $this->text_direction && strpos( $GLOBALS['wp_version'], '-src' ) ) { |
|
214 | + if ('rtl' === $this->text_direction && strpos($GLOBALS['wp_version'], '-src')) { |
|
215 | 215 | $this->text_direction = 'ltr'; |
216 | - add_action( 'all_admin_notices', array( $this, 'rtl_src_admin_notice' ) ); |
|
216 | + add_action('all_admin_notices', array($this, 'rtl_src_admin_notice')); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function rtl_src_admin_notice() { |
227 | 227 | /* translators: %s: Name of the directory (build) */ |
228 | - echo '<div class="error"><p>' . sprintf( __( 'The %s directory of the develop repository must be used for RTL.' ), '<code>build</code>' ) . '</p></div>'; |
|
228 | + echo '<div class="error"><p>'.sprintf(__('The %s directory of the develop repository must be used for RTL.'), '<code>build</code>').'</p></div>'; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -384,11 +384,11 @@ discard block |
||
384 | 384 | */ |
385 | 385 | public function _strings_for_pot() { |
386 | 386 | /* translators: localized date format, see http://php.net/date */ |
387 | - __( 'F j, Y' ); |
|
387 | + __('F j, Y'); |
|
388 | 388 | /* translators: localized time format, see http://php.net/date */ |
389 | - __( 'g:i a' ); |
|
389 | + __('g:i a'); |
|
390 | 390 | /* translators: localized date and time format, see http://php.net/date */ |
391 | - __( 'F j, Y g:i a' ); |
|
391 | + __('F j, Y g:i a'); |
|
392 | 392 | } |
393 | 393 | } |
394 | 394 |
@@ -91,13 +91,19 @@ |
||
91 | 91 | <guid isPermaLink="false"><?php the_guid(); ?></guid> |
92 | 92 | <?php if (get_option('rss_use_excerpt')) : ?> |
93 | 93 | <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description> |
94 | -<?php else : ?> |
|
95 | - <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description> |
|
94 | +<?php else { |
|
95 | + : ?> |
|
96 | + <description><![CDATA[<?php the_excerpt_rss(); |
|
97 | +} |
|
98 | +?>]]></description> |
|
96 | 99 | <?php $content = get_the_content_feed('rss2'); ?> |
97 | 100 | <?php if ( strlen( $content ) > 0 ) : ?> |
98 | 101 | <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded> |
99 | - <?php else : ?> |
|
100 | - <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded> |
|
102 | + <?php else { |
|
103 | + : ?> |
|
104 | + <content:encoded><![CDATA[<?php the_excerpt_rss(); |
|
105 | +} |
|
106 | +?>]]></content:encoded> |
|
101 | 107 | <?php endif; ?> |
102 | 108 | <?php endif; ?> |
103 | 109 | <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @package WordPress |
6 | 6 | */ |
7 | 7 | |
8 | -header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true); |
|
8 | +header('Content-Type: '.feed_content_type('rss2').'; charset='.get_option('blog_charset'), true); |
|
9 | 9 | $more = 1; |
10 | 10 | |
11 | 11 | echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments', |
19 | 19 | * 'rdf', 'atom', and 'atom-comments'. |
20 | 20 | */ |
21 | -do_action( 'rss_tag_pre', 'rss2' ); |
|
21 | +do_action('rss_tag_pre', 'rss2'); |
|
22 | 22 | ?> |
23 | 23 | <rss version="2.0" |
24 | 24 | xmlns:content="http://purl.org/rss/1.0/modules/content/" |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @since 2.0.0 |
35 | 35 | */ |
36 | - do_action( 'rss2_ns' ); |
|
36 | + do_action('rss2_ns'); |
|
37 | 37 | ?> |
38 | 38 | > |
39 | 39 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | <link><?php bloginfo_rss('url') ?></link> |
44 | 44 | <description><?php bloginfo_rss("description") ?></description> |
45 | 45 | <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate> |
46 | - <language><?php bloginfo_rss( 'language' ); ?></language> |
|
46 | + <language><?php bloginfo_rss('language'); ?></language> |
|
47 | 47 | <sy:updatePeriod><?php |
48 | 48 | $duration = 'hourly'; |
49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly', |
56 | 56 | * 'yearly'. Default 'hourly'. |
57 | 57 | */ |
58 | - echo apply_filters( 'rss_update_period', $duration ); |
|
58 | + echo apply_filters('rss_update_period', $duration); |
|
59 | 59 | ?></sy:updatePeriod> |
60 | 60 | <sy:updateFrequency><?php |
61 | 61 | $frequency = '1'; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param string $frequency An integer passed as a string representing the frequency |
69 | 69 | * of RSS updates within the update period. Default '1'. |
70 | 70 | */ |
71 | - echo apply_filters( 'rss_update_frequency', $frequency ); |
|
71 | + echo apply_filters('rss_update_frequency', $frequency); |
|
72 | 72 | ?></sy:updateFrequency> |
73 | 73 | <?php |
74 | 74 | /** |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @since 2.0.0 |
78 | 78 | */ |
79 | - do_action( 'rss2_head'); |
|
79 | + do_action('rss2_head'); |
|
80 | 80 | |
81 | - while( have_posts()) : the_post(); |
|
81 | + while (have_posts()) : the_post(); |
|
82 | 82 | ?> |
83 | 83 | <item> |
84 | 84 | <title><?php the_title_rss() ?></title> |
85 | 85 | <link><?php the_permalink_rss() ?></link> |
86 | -<?php if ( get_comments_number() || comments_open() ) : ?> |
|
86 | +<?php if (get_comments_number() || comments_open()) : ?> |
|
87 | 87 | <comments><?php comments_link_feed(); ?></comments> |
88 | 88 | <?php endif; ?> |
89 | 89 | <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | <?php else : ?> |
97 | 97 | <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description> |
98 | 98 | <?php $content = get_the_content_feed('rss2'); ?> |
99 | - <?php if ( strlen( $content ) > 0 ) : ?> |
|
99 | + <?php if (strlen($content) > 0) : ?> |
|
100 | 100 | <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded> |
101 | 101 | <?php else : ?> |
102 | 102 | <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded> |
103 | 103 | <?php endif; ?> |
104 | 104 | <?php endif; ?> |
105 | -<?php if ( get_comments_number() || comments_open() ) : ?> |
|
106 | - <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss> |
|
105 | +<?php if (get_comments_number() || comments_open()) : ?> |
|
106 | + <wfw:commentRss><?php echo esc_url(get_post_comments_feed_link(null, 'rss2')); ?></wfw:commentRss> |
|
107 | 107 | <slash:comments><?php echo get_comments_number(); ?></slash:comments> |
108 | 108 | <?php endif; ?> |
109 | 109 | <?php rss_enclosure(); ?> |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @since 2.0.0 |
115 | 115 | */ |
116 | - do_action( 'rss2_item' ); |
|
116 | + do_action('rss2_item'); |
|
117 | 117 | ?> |
118 | 118 | </item> |
119 | 119 | <?php endwhile; ?> |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | // We should only use the last Content-Type header. c.f. issue #1 |
259 | 259 | if (isset($this->headers[$this->name]) && $this->name !== 'content-type') |
260 | 260 | { |
261 | - $this->headers[$this->name] .= ', ' . $this->value; |
|
261 | + $this->headers[$this->name] .= ', '.$this->value; |
|
262 | 262 | } |
263 | 263 | else |
264 | 264 | { |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | protected function body() |
442 | 442 | { |
443 | 443 | $this->body = substr($this->data, $this->position); |
444 | - if (!empty($this->headers['transfer-encoding'])) |
|
444 | + if ( ! empty($this->headers['transfer-encoding'])) |
|
445 | 445 | { |
446 | 446 | unset($this->headers['transfer-encoding']); |
447 | 447 | $this->state = 'chunked'; |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | */ |
458 | 458 | protected function chunked() |
459 | 459 | { |
460 | - if (!preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($this->body))) |
|
460 | + if ( ! preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($this->body))) |
|
461 | 461 | { |
462 | 462 | $this->state = 'emit'; |
463 | 463 | return; |
@@ -468,8 +468,8 @@ discard block |
||
468 | 468 | |
469 | 469 | while (true) |
470 | 470 | { |
471 | - $is_chunked = (bool) preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches ); |
|
472 | - if (!$is_chunked) |
|
471 | + $is_chunked = (bool) preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches); |
|
472 | + if ( ! $is_chunked) |
|
473 | 473 | { |
474 | 474 | // Looks like it's not chunked after all |
475 | 475 | $this->state = 'emit'; |
@@ -155,8 +155,7 @@ discard block |
||
155 | 155 | if ($this->state === 'emit' || $this->state === 'body') |
156 | 156 | { |
157 | 157 | return true; |
158 | - } |
|
159 | - else |
|
158 | + } else |
|
160 | 159 | { |
161 | 160 | $this->http_version = ''; |
162 | 161 | $this->status_code = ''; |
@@ -206,13 +205,11 @@ discard block |
||
206 | 205 | $this->http_version = (float) $this->http_version; |
207 | 206 | $this->position += strspn($this->data, "\x09\x20", $this->position); |
208 | 207 | $this->state = 'status'; |
209 | - } |
|
210 | - else |
|
208 | + } else |
|
211 | 209 | { |
212 | 210 | $this->state = false; |
213 | 211 | } |
214 | - } |
|
215 | - else |
|
212 | + } else |
|
216 | 213 | { |
217 | 214 | $this->state = false; |
218 | 215 | } |
@@ -228,8 +225,7 @@ discard block |
||
228 | 225 | $this->status_code = (int) substr($this->data, $this->position, $len); |
229 | 226 | $this->position += $len; |
230 | 227 | $this->state = 'reason'; |
231 | - } |
|
232 | - else |
|
228 | + } else |
|
233 | 229 | { |
234 | 230 | $this->state = false; |
235 | 231 | } |
@@ -259,8 +255,7 @@ discard block |
||
259 | 255 | if (isset($this->headers[$this->name]) && $this->name !== 'content-type') |
260 | 256 | { |
261 | 257 | $this->headers[$this->name] .= ', ' . $this->value; |
262 | - } |
|
263 | - else |
|
258 | + } else |
|
264 | 259 | { |
265 | 260 | $this->headers[$this->name] = $this->value; |
266 | 261 | } |
@@ -271,13 +266,11 @@ discard block |
||
271 | 266 | { |
272 | 267 | $this->position += 2; |
273 | 268 | $this->state = 'body'; |
274 | - } |
|
275 | - elseif ($this->data[$this->position] === "\x0A") |
|
269 | + } elseif ($this->data[$this->position] === "\x0A") |
|
276 | 270 | { |
277 | 271 | $this->position++; |
278 | 272 | $this->state = 'body'; |
279 | - } |
|
280 | - else |
|
273 | + } else |
|
281 | 274 | { |
282 | 275 | $this->state = 'name'; |
283 | 276 | } |
@@ -295,15 +288,13 @@ discard block |
||
295 | 288 | { |
296 | 289 | $this->position += $len; |
297 | 290 | $this->state = 'new_line'; |
298 | - } |
|
299 | - else |
|
291 | + } else |
|
300 | 292 | { |
301 | 293 | $this->name = substr($this->data, $this->position, $len); |
302 | 294 | $this->position += $len + 1; |
303 | 295 | $this->state = 'value'; |
304 | 296 | } |
305 | - } |
|
306 | - else |
|
297 | + } else |
|
307 | 298 | { |
308 | 299 | $this->state = false; |
309 | 300 | } |
@@ -319,8 +310,7 @@ discard block |
||
319 | 310 | if (substr($this->data, $this->position, 2) === "\x0D\x0A") |
320 | 311 | { |
321 | 312 | $this->position += 2; |
322 | - } |
|
323 | - elseif ($this->data[$this->position] === "\x0A") |
|
313 | + } elseif ($this->data[$this->position] === "\x0A") |
|
324 | 314 | { |
325 | 315 | $this->position++; |
326 | 316 | } |
@@ -337,8 +327,7 @@ discard block |
||
337 | 327 | if ($this->is_linear_whitespace()) |
338 | 328 | { |
339 | 329 | $this->linear_whitespace(); |
340 | - } |
|
341 | - else |
|
330 | + } else |
|
342 | 331 | { |
343 | 332 | switch ($this->data[$this->position]) |
344 | 333 | { |
@@ -387,8 +376,7 @@ discard block |
||
387 | 376 | if ($this->is_linear_whitespace()) |
388 | 377 | { |
389 | 378 | $this->linear_whitespace(); |
390 | - } |
|
391 | - else |
|
379 | + } else |
|
392 | 380 | { |
393 | 381 | switch ($this->data[$this->position]) |
394 | 382 | { |
@@ -445,8 +433,7 @@ discard block |
||
445 | 433 | { |
446 | 434 | unset($this->headers['transfer-encoding']); |
447 | 435 | $this->state = 'chunked'; |
448 | - } |
|
449 | - else |
|
436 | + } else |
|
450 | 437 | { |
451 | 438 | $this->state = 'emit'; |
452 | 439 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); |
198 | 198 | } |
199 | 199 | |
200 | - if (!empty($categories)) |
|
200 | + if ( ! empty($categories)) |
|
201 | 201 | { |
202 | 202 | return array_unique($categories); |
203 | 203 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); |
281 | 281 | } |
282 | 282 | |
283 | - if (!empty($authors)) |
|
283 | + if ( ! empty($authors)) |
|
284 | 284 | { |
285 | 285 | return array_unique($authors); |
286 | 286 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } |
352 | 352 | } |
353 | 353 | |
354 | - if (!empty($contributors)) |
|
354 | + if ( ! empty($contributors)) |
|
355 | 355 | { |
356 | 356 | return array_unique($contributors); |
357 | 357 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | |
385 | 385 | public function get_links($rel = 'alternate') |
386 | 386 | { |
387 | - if (!isset($this->data['links'])) |
|
387 | + if ( ! isset($this->data['links'])) |
|
388 | 388 | { |
389 | 389 | $this->data['links'] = array(); |
390 | 390 | if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link')) |
@@ -428,19 +428,19 @@ discard block |
||
428 | 428 | { |
429 | 429 | if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) |
430 | 430 | { |
431 | - if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) |
|
431 | + if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key])) |
|
432 | 432 | { |
433 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); |
|
434 | - $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; |
|
433 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]); |
|
434 | + $this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]; |
|
435 | 435 | } |
436 | 436 | else |
437 | 437 | { |
438 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; |
|
438 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key]; |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
442 | 442 | { |
443 | - $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; |
|
443 | + $this->data['links'][substr($key, 41)] = & $this->data['links'][$key]; |
|
444 | 444 | } |
445 | 445 | $this->data['links'][$key] = array_unique($this->data['links'][$key]); |
446 | 446 | } |
@@ -79,8 +79,7 @@ discard block |
||
79 | 79 | if (isset($this->data['child'][$namespace][$tag])) |
80 | 80 | { |
81 | 81 | return $this->data['child'][$namespace][$tag]; |
82 | - } |
|
83 | - else |
|
82 | + } else |
|
84 | 83 | { |
85 | 84 | return null; |
86 | 85 | } |
@@ -106,32 +105,25 @@ discard block |
||
106 | 105 | if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) |
107 | 106 | { |
108 | 107 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
109 | - } |
|
110 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) |
|
108 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) |
|
111 | 109 | { |
112 | 110 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
113 | - } |
|
114 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) |
|
111 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) |
|
115 | 112 | { |
116 | 113 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
117 | - } |
|
118 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) |
|
114 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) |
|
119 | 115 | { |
120 | 116 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
121 | - } |
|
122 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) |
|
117 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) |
|
123 | 118 | { |
124 | 119 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
125 | - } |
|
126 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) |
|
120 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) |
|
127 | 121 | { |
128 | 122 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
129 | - } |
|
130 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) |
|
123 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) |
|
131 | 124 | { |
132 | 125 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
133 | - } |
|
134 | - else |
|
126 | + } else |
|
135 | 127 | { |
136 | 128 | return null; |
137 | 129 | } |
@@ -143,8 +135,7 @@ discard block |
||
143 | 135 | if (isset($categories[$key])) |
144 | 136 | { |
145 | 137 | return $categories[$key]; |
146 | - } |
|
147 | - else |
|
138 | + } else |
|
148 | 139 | { |
149 | 140 | return null; |
150 | 141 | } |
@@ -181,8 +172,7 @@ discard block |
||
181 | 172 | if (isset($category['attribs']['']['domain'])) |
182 | 173 | { |
183 | 174 | $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); |
184 | - } |
|
185 | - else |
|
175 | + } else |
|
186 | 176 | { |
187 | 177 | $scheme = null; |
188 | 178 | } |
@@ -200,8 +190,7 @@ discard block |
||
200 | 190 | if (!empty($categories)) |
201 | 191 | { |
202 | 192 | return array_unique($categories); |
203 | - } |
|
204 | - else |
|
193 | + } else |
|
205 | 194 | { |
206 | 195 | return null; |
207 | 196 | } |
@@ -213,8 +202,7 @@ discard block |
||
213 | 202 | if (isset($authors[$key])) |
214 | 203 | { |
215 | 204 | return $authors[$key]; |
216 | - } |
|
217 | - else |
|
205 | + } else |
|
218 | 206 | { |
219 | 207 | return null; |
220 | 208 | } |
@@ -283,8 +271,7 @@ discard block |
||
283 | 271 | if (!empty($authors)) |
284 | 272 | { |
285 | 273 | return array_unique($authors); |
286 | - } |
|
287 | - else |
|
274 | + } else |
|
288 | 275 | { |
289 | 276 | return null; |
290 | 277 | } |
@@ -296,8 +283,7 @@ discard block |
||
296 | 283 | if (isset($contributors[$key])) |
297 | 284 | { |
298 | 285 | return $contributors[$key]; |
299 | - } |
|
300 | - else |
|
286 | + } else |
|
301 | 287 | { |
302 | 288 | return null; |
303 | 289 | } |
@@ -354,8 +340,7 @@ discard block |
||
354 | 340 | if (!empty($contributors)) |
355 | 341 | { |
356 | 342 | return array_unique($contributors); |
357 | - } |
|
358 | - else |
|
343 | + } else |
|
359 | 344 | { |
360 | 345 | return null; |
361 | 346 | } |
@@ -367,8 +352,7 @@ discard block |
||
367 | 352 | if (isset($links[$key])) |
368 | 353 | { |
369 | 354 | return $links[$key]; |
370 | - } |
|
371 | - else |
|
355 | + } else |
|
372 | 356 | { |
373 | 357 | return null; |
374 | 358 | } |
@@ -432,13 +416,11 @@ discard block |
||
432 | 416 | { |
433 | 417 | $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); |
434 | 418 | $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; |
435 | - } |
|
436 | - else |
|
419 | + } else |
|
437 | 420 | { |
438 | 421 | $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; |
439 | 422 | } |
440 | - } |
|
441 | - elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
|
423 | + } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
|
442 | 424 | { |
443 | 425 | $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; |
444 | 426 | } |
@@ -449,8 +431,7 @@ discard block |
||
449 | 431 | if (isset($this->data['links'][$rel])) |
450 | 432 | { |
451 | 433 | return $this->data['links'][$rel]; |
452 | - } |
|
453 | - else |
|
434 | + } else |
|
454 | 435 | { |
455 | 436 | return null; |
456 | 437 | } |
@@ -461,40 +442,31 @@ discard block |
||
461 | 442 | if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle')) |
462 | 443 | { |
463 | 444 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
464 | - } |
|
465 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline')) |
|
445 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline')) |
|
466 | 446 | { |
467 | 447 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
468 | - } |
|
469 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) |
|
448 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) |
|
470 | 449 | { |
471 | 450 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
472 | - } |
|
473 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) |
|
451 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) |
|
474 | 452 | { |
475 | 453 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
476 | - } |
|
477 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) |
|
454 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) |
|
478 | 455 | { |
479 | 456 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
480 | - } |
|
481 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) |
|
457 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) |
|
482 | 458 | { |
483 | 459 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
484 | - } |
|
485 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) |
|
460 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) |
|
486 | 461 | { |
487 | 462 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
488 | - } |
|
489 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) |
|
463 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) |
|
490 | 464 | { |
491 | 465 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); |
492 | - } |
|
493 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) |
|
466 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) |
|
494 | 467 | { |
495 | 468 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); |
496 | - } |
|
497 | - else |
|
469 | + } else |
|
498 | 470 | { |
499 | 471 | return null; |
500 | 472 | } |
@@ -505,24 +477,19 @@ discard block |
||
505 | 477 | if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) |
506 | 478 | { |
507 | 479 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
508 | - } |
|
509 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright')) |
|
480 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright')) |
|
510 | 481 | { |
511 | 482 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
512 | - } |
|
513 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) |
|
483 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) |
|
514 | 484 | { |
515 | 485 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
516 | - } |
|
517 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) |
|
486 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) |
|
518 | 487 | { |
519 | 488 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
520 | - } |
|
521 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) |
|
489 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) |
|
522 | 490 | { |
523 | 491 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
524 | - } |
|
525 | - else |
|
492 | + } else |
|
526 | 493 | { |
527 | 494 | return null; |
528 | 495 | } |
@@ -533,20 +500,16 @@ discard block |
||
533 | 500 | if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) |
534 | 501 | { |
535 | 502 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
536 | - } |
|
537 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language')) |
|
503 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language')) |
|
538 | 504 | { |
539 | 505 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
540 | - } |
|
541 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language')) |
|
506 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language')) |
|
542 | 507 | { |
543 | 508 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
544 | - } |
|
545 | - elseif (isset($this->data['xml_lang'])) |
|
509 | + } elseif (isset($this->data['xml_lang'])) |
|
546 | 510 | { |
547 | 511 | return $this->sanitize($this->data['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); |
548 | - } |
|
549 | - else |
|
512 | + } else |
|
550 | 513 | { |
551 | 514 | return null; |
552 | 515 | } |
@@ -557,12 +520,10 @@ discard block |
||
557 | 520 | if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) |
558 | 521 | { |
559 | 522 | return (float) $return[0]['data']; |
560 | - } |
|
561 | - elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
523 | + } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
562 | 524 | { |
563 | 525 | return (float) $match[1]; |
564 | - } |
|
565 | - else |
|
526 | + } else |
|
566 | 527 | { |
567 | 528 | return null; |
568 | 529 | } |
@@ -573,16 +534,13 @@ discard block |
||
573 | 534 | if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) |
574 | 535 | { |
575 | 536 | return (float) $return[0]['data']; |
576 | - } |
|
577 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) |
|
537 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) |
|
578 | 538 | { |
579 | 539 | return (float) $return[0]['data']; |
580 | - } |
|
581 | - elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
540 | + } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
582 | 541 | { |
583 | 542 | return (float) $match[2]; |
584 | - } |
|
585 | - else |
|
543 | + } else |
|
586 | 544 | { |
587 | 545 | return null; |
588 | 546 | } |
@@ -593,16 +551,13 @@ discard block |
||
593 | 551 | if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image')) |
594 | 552 | { |
595 | 553 | return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI); |
596 | - } |
|
597 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo')) |
|
554 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo')) |
|
598 | 555 | { |
599 | 556 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); |
600 | - } |
|
601 | - elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) |
|
557 | + } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) |
|
602 | 558 | { |
603 | 559 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); |
604 | - } |
|
605 | - else |
|
560 | + } else |
|
606 | 561 | { |
607 | 562 | return null; |
608 | 563 | } |
@@ -1,46 +1,46 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * SimplePie |
|
4 | - * |
|
5 | - * A PHP-Based RSS and Atom Feed Framework. |
|
6 | - * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | - * |
|
8 | - * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | - * All rights reserved. |
|
10 | - * |
|
11 | - * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | - * permitted provided that the following conditions are met: |
|
13 | - * |
|
14 | - * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | - * conditions and the following disclaimer. |
|
16 | - * |
|
17 | - * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | - * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | - * provided with the distribution. |
|
20 | - * |
|
21 | - * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | - * to endorse or promote products derived from this software without specific prior |
|
23 | - * written permission. |
|
24 | - * |
|
25 | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | - * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | - * POSSIBILITY OF SUCH DAMAGE. |
|
34 | - * |
|
35 | - * @package SimplePie |
|
36 | - * @version 1.3.1 |
|
37 | - * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | - * @author Ryan Parman |
|
39 | - * @author Geoffrey Sneddon |
|
40 | - * @author Ryan McCue |
|
41 | - * @link http://simplepie.org/ SimplePie |
|
42 | - * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | - */ |
|
3 | + * SimplePie |
|
4 | + * |
|
5 | + * A PHP-Based RSS and Atom Feed Framework. |
|
6 | + * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | + * |
|
8 | + * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | + * All rights reserved. |
|
10 | + * |
|
11 | + * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | + * permitted provided that the following conditions are met: |
|
13 | + * |
|
14 | + * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | + * conditions and the following disclaimer. |
|
16 | + * |
|
17 | + * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | + * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | + * provided with the distribution. |
|
20 | + * |
|
21 | + * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | + * to endorse or promote products derived from this software without specific prior |
|
23 | + * written permission. |
|
24 | + * |
|
25 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | + * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | + * POSSIBILITY OF SUCH DAMAGE. |
|
34 | + * |
|
35 | + * @package SimplePie |
|
36 | + * @version 1.3.1 |
|
37 | + * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | + * @author Ryan Parman |
|
39 | + * @author Geoffrey Sneddon |
|
40 | + * @author Ryan McCue |
|
41 | + * @link http://simplepie.org/ SimplePie |
|
42 | + * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | + */ |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Manages all author-related data |
@@ -83,7 +83,7 @@ |
||
83 | 83 | { |
84 | 84 | $type = explode(':', $location, 2); |
85 | 85 | $type = $type[0]; |
86 | - if (!empty(self::$handlers[$type])) |
|
86 | + if ( ! empty(self::$handlers[$type])) |
|
87 | 87 | { |
88 | 88 | $class = self::$handlers[$type]; |
89 | 89 | return new $class($location, $filename, $extension); |
@@ -1,46 +1,46 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * SimplePie |
|
4 | - * |
|
5 | - * A PHP-Based RSS and Atom Feed Framework. |
|
6 | - * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | - * |
|
8 | - * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | - * All rights reserved. |
|
10 | - * |
|
11 | - * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | - * permitted provided that the following conditions are met: |
|
13 | - * |
|
14 | - * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | - * conditions and the following disclaimer. |
|
16 | - * |
|
17 | - * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | - * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | - * provided with the distribution. |
|
20 | - * |
|
21 | - * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | - * to endorse or promote products derived from this software without specific prior |
|
23 | - * written permission. |
|
24 | - * |
|
25 | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | - * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | - * POSSIBILITY OF SUCH DAMAGE. |
|
34 | - * |
|
35 | - * @package SimplePie |
|
36 | - * @version 1.3.1 |
|
37 | - * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | - * @author Ryan Parman |
|
39 | - * @author Geoffrey Sneddon |
|
40 | - * @author Ryan McCue |
|
41 | - * @link http://simplepie.org/ SimplePie |
|
42 | - * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | - */ |
|
3 | + * SimplePie |
|
4 | + * |
|
5 | + * A PHP-Based RSS and Atom Feed Framework. |
|
6 | + * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | + * |
|
8 | + * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | + * All rights reserved. |
|
10 | + * |
|
11 | + * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | + * permitted provided that the following conditions are met: |
|
13 | + * |
|
14 | + * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | + * conditions and the following disclaimer. |
|
16 | + * |
|
17 | + * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | + * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | + * provided with the distribution. |
|
20 | + * |
|
21 | + * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | + * to endorse or promote products derived from this software without specific prior |
|
23 | + * written permission. |
|
24 | + * |
|
25 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | + * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | + * POSSIBILITY OF SUCH DAMAGE. |
|
34 | + * |
|
35 | + * @package SimplePie |
|
36 | + * @version 1.3.1 |
|
37 | + * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | + * @author Ryan Parman |
|
39 | + * @author Geoffrey Sneddon |
|
40 | + * @author Ryan McCue |
|
41 | + * @link http://simplepie.org/ SimplePie |
|
42 | + * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | + */ |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Manages all author-related data |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | $useragent = ini_get('user_agent'); |
83 | 83 | $this->useragent = $useragent; |
84 | 84 | } |
85 | - if (!is_array($headers)) |
|
85 | + if ( ! is_array($headers)) |
|
86 | 86 | { |
87 | 87 | $headers = array(); |
88 | 88 | } |
89 | - if (!$force_fsockopen && function_exists('curl_exec')) |
|
89 | + if ( ! $force_fsockopen && function_exists('curl_exec')) |
|
90 | 90 | { |
91 | 91 | $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL; |
92 | 92 | $fp = curl_init(); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | curl_setopt($fp, CURLOPT_REFERER, $url); |
108 | 108 | curl_setopt($fp, CURLOPT_USERAGENT, $useragent); |
109 | 109 | curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); |
110 | - if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>=')) |
|
110 | + if ( ! ini_get('open_basedir') && ! ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>=')) |
|
111 | 111 | { |
112 | 112 | curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1); |
113 | 113 | curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | if (curl_errno($fp)) |
123 | 123 | { |
124 | - $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); |
|
124 | + $this->error = 'cURL error '.curl_errno($fp).': '.curl_error($fp); |
|
125 | 125 | $this->success = false; |
126 | 126 | } |
127 | 127 | else |
@@ -155,14 +155,14 @@ discard block |
||
155 | 155 | $socket_host = "ssl://$url_parts[host]"; |
156 | 156 | $url_parts['port'] = 443; |
157 | 157 | } |
158 | - if (!isset($url_parts['port'])) |
|
158 | + if ( ! isset($url_parts['port'])) |
|
159 | 159 | { |
160 | 160 | $url_parts['port'] = 80; |
161 | 161 | } |
162 | 162 | $fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout); |
163 | - if (!$fp) |
|
163 | + if ( ! $fp) |
|
164 | 164 | { |
165 | - $this->error = 'fsockopen error: ' . $errstr; |
|
165 | + $this->error = 'fsockopen error: '.$errstr; |
|
166 | 166 | $this->success = false; |
167 | 167 | } |
168 | 168 | else |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | if (isset($url_parts['user']) && isset($url_parts['pass'])) |
195 | 195 | { |
196 | - $out .= "Authorization: Basic " . base64_encode("$url_parts[user]:$url_parts[pass]") . "\r\n"; |
|
196 | + $out .= "Authorization: Basic ".base64_encode("$url_parts[user]:$url_parts[pass]")."\r\n"; |
|
197 | 197 | } |
198 | 198 | foreach ($headers as $key => $value) |
199 | 199 | { |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | $info = stream_get_meta_data($fp); |
206 | 206 | |
207 | 207 | $this->headers = ''; |
208 | - while (!$info['eof'] && !$info['timed_out']) |
|
208 | + while ( ! $info['eof'] && ! $info['timed_out']) |
|
209 | 209 | { |
210 | 210 | $this->headers .= fread($fp, 1160); |
211 | 211 | $info = stream_get_meta_data($fp); |
212 | 212 | } |
213 | - if (!$info['timed_out']) |
|
213 | + if ( ! $info['timed_out']) |
|
214 | 214 | { |
215 | 215 | $parser = new SimplePie_HTTP_Parser($this->headers); |
216 | 216 | if ($parser->parse()) |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | case 'gzip': |
233 | 233 | case 'x-gzip': |
234 | 234 | $decoder = new SimplePie_gzdecode($this->body); |
235 | - if (!$decoder->parse()) |
|
235 | + if ( ! $decoder->parse()) |
|
236 | 236 | { |
237 | 237 | $this->error = 'Unable to decode HTTP "gzip" stream'; |
238 | 238 | $this->success = false; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | else |
283 | 283 | { |
284 | 284 | $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS; |
285 | - if (!$this->body = file_get_contents($url)) |
|
285 | + if ( ! $this->body = file_get_contents($url)) |
|
286 | 286 | { |
287 | 287 | $this->error = 'file_get_contents could not read the file'; |
288 | 288 | $this->success = false; |
@@ -123,8 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); |
125 | 125 | $this->success = false; |
126 | - } |
|
127 | - else |
|
126 | + } else |
|
128 | 127 | { |
129 | 128 | $info = curl_getinfo($fp); |
130 | 129 | curl_close($fp); |
@@ -144,8 +143,7 @@ discard block |
||
144 | 143 | } |
145 | 144 | } |
146 | 145 | } |
147 | - } |
|
148 | - else |
|
146 | + } else |
|
149 | 147 | { |
150 | 148 | $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; |
151 | 149 | $url_parts = parse_url($url); |
@@ -164,8 +162,7 @@ discard block |
||
164 | 162 | { |
165 | 163 | $this->error = 'fsockopen error: ' . $errstr; |
166 | 164 | $this->success = false; |
167 | - } |
|
168 | - else |
|
165 | + } else |
|
169 | 166 | { |
170 | 167 | stream_set_timeout($fp, $timeout); |
171 | 168 | if (isset($url_parts['path'])) |
@@ -173,13 +170,11 @@ discard block |
||
173 | 170 | if (isset($url_parts['query'])) |
174 | 171 | { |
175 | 172 | $get = "$url_parts[path]?$url_parts[query]"; |
176 | - } |
|
177 | - else |
|
173 | + } else |
|
178 | 174 | { |
179 | 175 | $get = $url_parts['path']; |
180 | 176 | } |
181 | - } |
|
182 | - else |
|
177 | + } else |
|
183 | 178 | { |
184 | 179 | $get = '/'; |
185 | 180 | } |
@@ -236,8 +231,7 @@ discard block |
||
236 | 231 | { |
237 | 232 | $this->error = 'Unable to decode HTTP "gzip" stream'; |
238 | 233 | $this->success = false; |
239 | - } |
|
240 | - else |
|
234 | + } else |
|
241 | 235 | { |
242 | 236 | $this->body = $decoder->data; |
243 | 237 | } |
@@ -247,16 +241,13 @@ discard block |
||
247 | 241 | if (($decompressed = gzinflate($this->body)) !== false) |
248 | 242 | { |
249 | 243 | $this->body = $decompressed; |
250 | - } |
|
251 | - else if (($decompressed = gzuncompress($this->body)) !== false) |
|
244 | + } else if (($decompressed = gzuncompress($this->body)) !== false) |
|
252 | 245 | { |
253 | 246 | $this->body = $decompressed; |
254 | - } |
|
255 | - else if (function_exists('gzdecode') && ($decompressed = gzdecode($this->body)) !== false) |
|
247 | + } else if (function_exists('gzdecode') && ($decompressed = gzdecode($this->body)) !== false) |
|
256 | 248 | { |
257 | 249 | $this->body = $decompressed; |
258 | - } |
|
259 | - else |
|
250 | + } else |
|
260 | 251 | { |
261 | 252 | $this->error = 'Unable to decode HTTP "deflate" stream'; |
262 | 253 | $this->success = false; |
@@ -269,8 +260,7 @@ discard block |
||
269 | 260 | } |
270 | 261 | } |
271 | 262 | } |
272 | - } |
|
273 | - else |
|
263 | + } else |
|
274 | 264 | { |
275 | 265 | $this->error = 'fsocket timed out'; |
276 | 266 | $this->success = false; |
@@ -278,8 +268,7 @@ discard block |
||
278 | 268 | fclose($fp); |
279 | 269 | } |
280 | 270 | } |
281 | - } |
|
282 | - else |
|
271 | + } else |
|
283 | 272 | { |
284 | 273 | $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS; |
285 | 274 | if (!$this->body = file_get_contents($url)) |
@@ -1,46 +1,46 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * SimplePie |
|
4 | - * |
|
5 | - * A PHP-Based RSS and Atom Feed Framework. |
|
6 | - * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | - * |
|
8 | - * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | - * All rights reserved. |
|
10 | - * |
|
11 | - * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | - * permitted provided that the following conditions are met: |
|
13 | - * |
|
14 | - * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | - * conditions and the following disclaimer. |
|
16 | - * |
|
17 | - * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | - * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | - * provided with the distribution. |
|
20 | - * |
|
21 | - * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | - * to endorse or promote products derived from this software without specific prior |
|
23 | - * written permission. |
|
24 | - * |
|
25 | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | - * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | - * POSSIBILITY OF SUCH DAMAGE. |
|
34 | - * |
|
35 | - * @package SimplePie |
|
36 | - * @version 1.3.1 |
|
37 | - * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | - * @author Ryan Parman |
|
39 | - * @author Geoffrey Sneddon |
|
40 | - * @author Ryan McCue |
|
41 | - * @link http://simplepie.org/ SimplePie |
|
42 | - * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | - */ |
|
3 | + * SimplePie |
|
4 | + * |
|
5 | + * A PHP-Based RSS and Atom Feed Framework. |
|
6 | + * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | + * |
|
8 | + * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | + * All rights reserved. |
|
10 | + * |
|
11 | + * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | + * permitted provided that the following conditions are met: |
|
13 | + * |
|
14 | + * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | + * conditions and the following disclaimer. |
|
16 | + * |
|
17 | + * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | + * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | + * provided with the distribution. |
|
20 | + * |
|
21 | + * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | + * to endorse or promote products derived from this software without specific prior |
|
23 | + * written permission. |
|
24 | + * |
|
25 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | + * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | + * POSSIBILITY OF SUCH DAMAGE. |
|
34 | + * |
|
35 | + * @package SimplePie |
|
36 | + * @version 1.3.1 |
|
37 | + * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | + * @author Ryan Parman |
|
39 | + * @author Geoffrey Sneddon |
|
40 | + * @author Ryan McCue |
|
41 | + * @link http://simplepie.org/ SimplePie |
|
42 | + * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | + */ |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Manages all author-related data |