Media: Use numeric timestamps instead of string-based timestamps when preparing an attachment for js.
We use the 'date' attribute to create Javascript Date objects. The Date() constructor has better cross-browser compatibility when numeric arguments are passed to the constructor. see #21390. git-svn-id: http://core.svn.wordpress.org/trunk@21691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9bd2e882ee
commit
da9864c82a
|
@ -1565,8 +1565,8 @@ function wp_prepare_attachment_for_js( $attachment ) {
|
|||
'name' => $attachment->post_name,
|
||||
'status' => $attachment->post_status,
|
||||
'uploadedTo' => $attachment->post_parent,
|
||||
'date' => $attachment->post_date_gmt . ' UTC',
|
||||
'modified' => $attachment->post_modified_gmt . ' UTC',
|
||||
'date' => strtotime( $attachment->post_date_gmt ) * 1000,
|
||||
'modified' => strtotime( $attachment->post_modified_gmt ) * 1000,
|
||||
'mime' => $attachment->post_mime_type,
|
||||
'type' => $type,
|
||||
'subtype' => $subtype,
|
||||
|
|
Loading…
Reference in New Issue