@@ -145,27 +145,27 @@ discard block |
||
| 145 | 145 | * @internal |
| 146 | 146 | * @param int $iid the id number of the image in the WP database |
| 147 | 147 | */ |
| 148 | - protected function get_image_info( $iid ) { |
|
| 148 | + protected function get_image_info($iid) { |
|
| 149 | 149 | $image_info = $iid; |
| 150 | - if (is_numeric($iid)) { |
|
| 150 | + if ( is_numeric($iid) ) { |
|
| 151 | 151 | $image_info = wp_get_attachment_metadata($iid); |
| 152 | - if (!is_array($image_info)) { |
|
| 152 | + if ( !is_array($image_info) ) { |
|
| 153 | 153 | $image_info = array(); |
| 154 | 154 | } |
| 155 | 155 | $image_custom = get_post_custom($iid); |
| 156 | 156 | $basic = get_post($iid); |
| 157 | - if ($basic) { |
|
| 158 | - if (isset($basic->post_excerpt)) { |
|
| 157 | + if ( $basic ) { |
|
| 158 | + if ( isset($basic->post_excerpt) ) { |
|
| 159 | 159 | $this->caption = $basic->post_excerpt; |
| 160 | 160 | } |
| 161 | 161 | $image_custom = array_merge($image_custom, get_object_vars($basic)); |
| 162 | 162 | } |
| 163 | 163 | return array_merge($image_info, $image_custom); |
| 164 | 164 | } |
| 165 | - if (is_array($image_info) && isset($image_info['image'])) { |
|
| 165 | + if ( is_array($image_info) && isset($image_info['image']) ) { |
|
| 166 | 166 | return $image_info['image']; |
| 167 | 167 | } |
| 168 | - if (is_object($image_info)) { |
|
| 168 | + if ( is_object($image_info) ) { |
|
| 169 | 169 | return get_object_vars($image_info); |
| 170 | 170 | } |
| 171 | 171 | return $iid; |
@@ -197,9 +197,9 @@ discard block |
||
| 197 | 197 | * @internal |
| 198 | 198 | * @param int $iid |
| 199 | 199 | */ |
| 200 | - function init( $iid = false ) { |
|
| 201 | - if ( !is_numeric( $iid ) && is_string( $iid ) ) { |
|
| 202 | - if (strstr($iid, '://')) { |
|
| 200 | + function init($iid = false) { |
|
| 201 | + if ( !is_numeric($iid) && is_string($iid) ) { |
|
| 202 | + if ( strstr($iid, '://') ) { |
|
| 203 | 203 | $this->init_with_url($iid); |
| 204 | 204 | return; |
| 205 | 205 | } |
@@ -210,9 +210,9 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | $relative = false; |
| 212 | 212 | $iid_lower = strtolower($iid); |
| 213 | - foreach( $this->file_types as $type ) { if( strstr( $iid_lower, $type ) ) { $relative = true; break; } }; |
|
| 213 | + foreach ($this->file_types as $type) { if ( strstr($iid_lower, $type) ) { $relative = true; break; } }; |
|
| 214 | 214 | if ( $relative ) { |
| 215 | - $this->init_with_relative_path( $iid ); |
|
| 215 | + $this->init_with_relative_path($iid); |
|
| 216 | 216 | return; |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -252,9 +252,9 @@ discard block |
||
| 252 | 252 | * @internal |
| 253 | 253 | * @param string $relative_path |
| 254 | 254 | */ |
| 255 | - protected function init_with_relative_path( $relative_path ) { |
|
| 256 | - $this->abs_url = home_url( $relative_path ); |
|
| 257 | - $file_path = TimberURLHelper::get_full_path( $relative_path ); |
|
| 255 | + protected function init_with_relative_path($relative_path) { |
|
| 256 | + $this->abs_url = home_url($relative_path); |
|
| 257 | + $file_path = TimberURLHelper::get_full_path($relative_path); |
|
| 258 | 258 | $this->file_loc = $file_path; |
| 259 | 259 | $this->file = $file_path; |
| 260 | 260 | } |
@@ -263,8 +263,8 @@ discard block |
||
| 263 | 263 | * @internal |
| 264 | 264 | * @param string $file_path |
| 265 | 265 | */ |
| 266 | - protected function init_with_file_path( $file_path ) { |
|
| 267 | - $url = TimberURLHelper::file_system_to_url( $file_path ); |
|
| 266 | + protected function init_with_file_path($file_path) { |
|
| 267 | + $url = TimberURLHelper::file_system_to_url($file_path); |
|
| 268 | 268 | $this->abs_url = $url; |
| 269 | 269 | $this->file_loc = $file_path; |
| 270 | 270 | $this->file = $file_path; |
@@ -463,8 +463,8 @@ discard block |
||
| 463 | 463 | * @param string $size |
| 464 | 464 | * @return bool|string |
| 465 | 465 | */ |
| 466 | - function get_src( $size = '' ) { |
|
| 467 | - return $this->src( $size ); |
|
| 466 | + function get_src($size = '') { |
|
| 467 | + return $this->src($size); |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | /** |