@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $dir = wp_upload_dir(); |
38 | 38 | |
39 | 39 | // Is URL in uploads directory? |
40 | - if ( false === strpos( $img_url, $dir['baseurl'] . '/' ) ) { |
|
40 | + if ( false === strpos( $img_url, $dir[ 'baseurl' ] . '/' ) ) { |
|
41 | 41 | return false; |
42 | 42 | } |
43 | 43 | |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | |
63 | 63 | foreach ( $query->posts as $post_id ) { |
64 | 64 | $meta = wp_get_attachment_metadata( $post_id ); |
65 | - $original_file = basename( $meta['file'] ); |
|
66 | - $cropped_image_files = isset( $meta['sizes'] ) ? wp_list_pluck( $meta['sizes'], 'file' ) : array(); |
|
65 | + $original_file = basename( $meta[ 'file' ] ); |
|
66 | + $cropped_image_files = isset( $meta[ 'sizes' ] ) ? wp_list_pluck( $meta[ 'sizes' ], 'file' ) : array(); |
|
67 | 67 | if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) { |
68 | 68 | $attachment_id = $post_id; |
69 | 69 | break; |
@@ -147,8 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | return self::is_valid_time_stamp( $string ) |
150 | - ? (int) $string : |
|
151 | - strtotime( (string) $string ); |
|
150 | + ? (int) $string : strtotime( (string) $string ); |
|
152 | 151 | } |
153 | 152 | |
154 | 153 | /** |
@@ -179,7 +178,7 @@ discard block |
||
179 | 178 | * @param mixed $value Value to check |
180 | 179 | * @return bool True or false |
181 | 180 | */ |
182 | - public static function notempty( $value ){ |
|
181 | + public static function notempty( $value ) { |
|
183 | 182 | return null !== $value && '' !== $value && false !== $value && array() !== $value; |
184 | 183 | } |
185 | 184 | |
@@ -337,24 +336,24 @@ discard block |
||
337 | 336 | |
338 | 337 | // order is relevant here, since the replacement will be done sequentially. |
339 | 338 | $supported_options = array( |
340 | - 'd' => 'dd', // Day, leading 0 |
|
341 | - 'j' => 'd', // Day, no 0 |
|
342 | - 'z' => 'o', // Day of the year, no leading zeroes, |
|
339 | + 'd' => 'dd', // Day, leading 0 |
|
340 | + 'j' => 'd', // Day, no 0 |
|
341 | + 'z' => 'o', // Day of the year, no leading zeroes, |
|
343 | 342 | // 'D' => 'D', // Day name short, not sure how it'll work with translations |
344 | 343 | // 'l' => 'DD', // Day name full, idem before |
345 | - 'm' => 'mm', // Month of the year, leading 0 |
|
346 | - 'n' => 'm', // Month of the year, no leading 0 |
|
344 | + 'm' => 'mm', // Month of the year, leading 0 |
|
345 | + 'n' => 'm', // Month of the year, no leading 0 |
|
347 | 346 | // 'M' => 'M', // Month, Short name |
348 | 347 | // 'F' => 'MM', // Month, full name, |
349 | - 'y' => 'y', // Year, two digit |
|
350 | - 'Y' => 'yy', // Year, full |
|
351 | - 'H' => 'HH', // Hour with leading 0 (24 hour) |
|
352 | - 'G' => 'H', // Hour with no leading 0 (24 hour) |
|
353 | - 'h' => 'hh', // Hour with leading 0 (12 hour) |
|
354 | - 'g' => 'h', // Hour with no leading 0 (12 hour), |
|
355 | - 'i' => 'mm', // Minute with leading 0, |
|
356 | - 's' => 'ss', // Second with leading 0, |
|
357 | - 'a' => 'tt', // am/pm |
|
348 | + 'y' => 'y', // Year, two digit |
|
349 | + 'Y' => 'yy', // Year, full |
|
350 | + 'H' => 'HH', // Hour with leading 0 (24 hour) |
|
351 | + 'G' => 'H', // Hour with no leading 0 (24 hour) |
|
352 | + 'h' => 'hh', // Hour with leading 0 (12 hour) |
|
353 | + 'g' => 'h', // Hour with no leading 0 (12 hour), |
|
354 | + 'i' => 'mm', // Minute with leading 0, |
|
355 | + 's' => 'ss', // Second with leading 0, |
|
356 | + 'a' => 'tt', // am/pm |
|
358 | 357 | 'A' => 'TT' // AM/PM |
359 | 358 | ); |
360 | 359 | |
@@ -375,7 +374,7 @@ discard block |
||
375 | 374 | * @return string Modified value |
376 | 375 | */ |
377 | 376 | public static function wrap_escaped_chars( $value ) { |
378 | - return "'" . str_replace( '\\', '', $value[0] ) . "'"; |
|
377 | + return "'" . str_replace( '\\', '', $value[ 0 ] ) . "'"; |
|
379 | 378 | } |
380 | 379 | |
381 | 380 | /** |
@@ -434,7 +433,7 @@ discard block |
||
434 | 433 | * @return string String of attributes for form element. |
435 | 434 | */ |
436 | 435 | public static function concat_attrs( $attrs, $attr_exclude = array() ) { |
437 | - $attr_exclude[] = 'rendered'; |
|
436 | + $attr_exclude[ ] = 'rendered'; |
|
438 | 437 | $attributes = ''; |
439 | 438 | foreach ( $attrs as $attr => $val ) { |
440 | 439 | $excluded = in_array( $attr, (array) $attr_exclude, true ); |
@@ -122,7 +122,8 @@ discard block |
||
122 | 122 | $tzstring = ''; |
123 | 123 | } |
124 | 124 | |
125 | - if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists |
|
125 | + if ( empty( $tzstring ) ) { |
|
126 | +// Create a UTC+- zone if no timezone string exists |
|
126 | 127 | if ( 0 == $current_offset ) { |
127 | 128 | $tzstring = 'UTC+0'; |
128 | 129 | } elseif ( $current_offset < 0 ) { |
@@ -179,7 +180,7 @@ discard block |
||
179 | 180 | * @param mixed $value Value to check |
180 | 181 | * @return bool True or false |
181 | 182 | */ |
182 | - public static function notempty( $value ){ |
|
183 | + public static function notempty( $value ) { |
|
183 | 184 | return null !== $value && '' !== $value && false !== $value && array() !== $value; |
184 | 185 | } |
185 | 186 |