@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | return $this->get_dimensions_loaded($dim); |
130 | 130 | } |
131 | 131 | if ( file_exists($this->file_loc) && filesize($this->file_loc) ) { |
132 | - if ( ImageHelper::is_svg( $this->file_loc ) ) { |
|
133 | - $svg_size = $this->svgs_get_dimensions( $this->file_loc ); |
|
132 | + if ( ImageHelper::is_svg($this->file_loc) ) { |
|
133 | + $svg_size = $this->svgs_get_dimensions($this->file_loc); |
|
134 | 134 | $this->_dimensions = array(); |
135 | 135 | $this->_dimensions[0] = $svg_size->width; |
136 | 136 | $this->_dimensions[1] = $svg_size->height; |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | * @return array |
153 | 153 | */ |
154 | 154 | protected function svgs_get_dimensions( $svg ) { |
155 | - $svg = simplexml_load_file( $svg ); |
|
155 | + $svg = simplexml_load_file($svg); |
|
156 | 156 | $width = '0'; |
157 | 157 | $height = '0'; |
158 | 158 | |
159 | 159 | if ( false !== $svg ) { |
160 | 160 | $attributes = $svg->attributes(); |
161 | - if ( isset( $attributes->viewBox ) ) { |
|
162 | - $viewbox = explode( ' ', $attributes->viewBox ); |
|
161 | + if ( isset($attributes->viewBox) ) { |
|
162 | + $viewbox = explode(' ', $attributes->viewBox); |
|
163 | 163 | $width = $viewbox[2]; |
164 | 164 | $height = $viewbox[3]; |
165 | 165 | } elseif ( $attributes->width && $attributes->height ) { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | public static function wp_upload_dir() { |
252 | 252 | static $wp_upload_dir = false; |
253 | 253 | |
254 | - if ( ! $wp_upload_dir || ( is_multisite() && ms_is_switched() ) ) { |
|
254 | + if ( !$wp_upload_dir || (is_multisite() && ms_is_switched()) ) { |
|
255 | 255 | $wp_upload_dir = wp_upload_dir(); |
256 | 256 | } |
257 | 257 | |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | return $this->_maybe_secure_url($this->abs_url); |
488 | 488 | } |
489 | 489 | |
490 | - if (!$this->is_image()) { |
|
490 | + if ( !$this->is_image() ) { |
|
491 | 491 | return wp_get_attachment_url($this->ID); |
492 | 492 | } |
493 | 493 | |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | * @return bool|string |
513 | 513 | */ |
514 | 514 | public function srcset( $size = "full" ) { |
515 | - if( $this->is_image() ){ |
|
515 | + if ( $this->is_image() ) { |
|
516 | 516 | return wp_get_attachment_image_srcset($this->ID, $size); |
517 | 517 | } |
518 | 518 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | * @return bool|string |
532 | 532 | */ |
533 | 533 | public function img_sizes( $size = "full" ) { |
534 | - if( $this->is_image() ){ |
|
534 | + if ( $this->is_image() ) { |
|
535 | 535 | return wp_get_attachment_image_sizes($this->ID, $size); |
536 | 536 | } |
537 | 537 | } |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | protected function is_image() { |
544 | 544 | $src = wp_get_attachment_url($this->ID); |
545 | - $image_exts = array( 'gif', 'jpg', 'jpeg', 'jpe', 'png', 'webp' ); |
|
545 | + $image_exts = array('gif', 'jpg', 'jpeg', 'jpe', 'png', 'webp'); |
|
546 | 546 | $check = wp_check_filetype(PathHelper::basename($src), null); |
547 | 547 | return in_array($check['ext'], $image_exts); |
548 | 548 | } |