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: https://develop.svn.wordpress.org/trunk@21691 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
62f79fd6e3
commit
436bf0016f
@ -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
Block a user