| @@ 1304-1307 (lines=4) @@ | ||
| 1301 | ||
| 1302 | if ( in_array( $ext, array( 'jpg', 'jpeg', 'png', 'gif' ) ) ) { |
|
| 1303 | $metadata = wp_get_attachment_metadata( $media_item->ID ); |
|
| 1304 | if ( isset( $metadata['height'], $metadata['width'] ) ) { |
|
| 1305 | $response['height'] = $metadata['height']; |
|
| 1306 | $response['width'] = $metadata['width']; |
|
| 1307 | } |
|
| 1308 | ||
| 1309 | if ( isset( $metadata['sizes'] ) ) { |
|
| 1310 | /** |
|
| @@ 1363-1366 (lines=4) @@ | ||
| 1360 | if ( $is_video ) { |
|
| 1361 | $metadata = wp_get_attachment_metadata( $media_item->ID ); |
|
| 1362 | ||
| 1363 | if ( isset( $metadata['height'], $metadata['width'] ) ) { |
|
| 1364 | $response['height'] = $metadata['height']; |
|
| 1365 | $response['width'] = $metadata['width']; |
|
| 1366 | } |
|
| 1367 | ||
| 1368 | if ( isset( $metadata['length'] ) ) { |
|
| 1369 | $response['length'] = $metadata['length']; |
|
| @@ 589-592 (lines=4) @@ | ||
| 586 | ||
| 587 | if ( in_array( $ext, array( 'jpg', 'jpeg', 'png', 'gif' ) ) ) { |
|
| 588 | $metadata = wp_get_attachment_metadata( $media_item->ID ); |
|
| 589 | if ( isset( $metadata['height'], $metadata['width'] ) ) { |
|
| 590 | $response['height'] = $metadata['height']; |
|
| 591 | $response['width'] = $metadata['width']; |
|
| 592 | } |
|
| 593 | ||
| 594 | if ( isset( $metadata['sizes'] ) ) { |
|
| 595 | /** |
|
| @@ 626-629 (lines=4) @@ | ||
| 623 | ||
| 624 | if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) { |
|
| 625 | $metadata = wp_get_attachment_metadata( $media_item->ID ); |
|
| 626 | if ( isset( $metadata['height'], $metadata['width'] ) ) { |
|
| 627 | $response['height'] = $metadata['height']; |
|
| 628 | $response['width'] = $metadata['width']; |
|
| 629 | } |
|
| 630 | ||
| 631 | if ( isset( $metadata['length'] ) ) { |
|
| 632 | $response['length'] = $metadata['length']; |
|
| @@ 192-195 (lines=4) @@ | ||
| 189 | ) |
|
| 190 | ); |
|
| 191 | ||
| 192 | if ( false !== $dimensions[ $image['src'] ] ) { |
|
| 193 | $image['src_width'] = $dimensions['width']; |
|
| 194 | $image['src_height'] = $dimensions['height']; |
|
| 195 | } |
|
| 196 | } |
|
| 197 | ||
| 198 | $metadata['image'] = array( |
|
| @@ 330-333 (lines=4) @@ | ||
| 327 | if ( $post_images && ! is_wp_error( $post_images ) ) { |
|
| 328 | foreach ( (array) $post_images as $post_image ) { |
|
| 329 | $image['src'] = $post_image['src']; |
|
| 330 | if ( isset( $post_image['src_width'], $post_image['src_height'] ) ) { |
|
| 331 | $image['width'] = $post_image['src_width']; |
|
| 332 | $image['height'] = $post_image['src_height']; |
|
| 333 | } |
|
| 334 | if ( ! empty( $post_image['alt_text'] ) ) { |
|
| 335 | $image['alt_text'] = $post_image['alt_text']; |
|
| 336 | } |
|