mirror of
git://develop.git.wordpress.org/
synced 2025-03-21 12:29:53 +01:00
Media: Replace some array keys with their numeric equivalent.
This change replaces `['0']` with `[0]` which brings better consistency, readability and performance. Props chintan1896, adamsilverstein, costdev. Fixes #53540. git-svn-id: https://develop.svn.wordpress.org/trunk@52245 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
53d604365e
commit
388b59319e
@ -3740,17 +3740,17 @@ function wp_get_media_creation_timestamp( $metadata ) {
|
||||
|
||||
case 'matroska':
|
||||
case 'webm':
|
||||
if ( isset( $metadata['matroska']['comments']['creation_time']['0'] ) ) {
|
||||
$creation_date = strtotime( $metadata['matroska']['comments']['creation_time']['0'] );
|
||||
} elseif ( isset( $metadata['matroska']['info']['0']['DateUTC_unix'] ) ) {
|
||||
$creation_date = (int) $metadata['matroska']['info']['0']['DateUTC_unix'];
|
||||
if ( isset( $metadata['matroska']['comments']['creation_time'][0] ) ) {
|
||||
$creation_date = strtotime( $metadata['matroska']['comments']['creation_time'][0] );
|
||||
} elseif ( isset( $metadata['matroska']['info'][0]['DateUTC_unix'] ) ) {
|
||||
$creation_date = (int) $metadata['matroska']['info'][0]['DateUTC_unix'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'quicktime':
|
||||
case 'mp4':
|
||||
if ( isset( $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'] ) ) {
|
||||
$creation_date = (int) $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'];
|
||||
if ( isset( $metadata['quicktime']['moov']['subatoms'][0]['creation_time_unix'] ) ) {
|
||||
$creation_date = (int) $metadata['quicktime']['moov']['subatoms'][0]['creation_time_unix'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1129,7 +1129,7 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f
|
||||
*/
|
||||
function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) {
|
||||
$image = wp_get_attachment_image_src( $attachment_id, $size, $icon );
|
||||
return isset( $image['0'] ) ? $image['0'] : false;
|
||||
return isset( $image[0] ) ? $image[0] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user