WordPress.org

Make WordPress Core

Changeset 21691


Ignore:
Timestamp:
08/31/2012 07:14:43 PM (8 years ago)
Author:
koopersmith
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r21683 r21691  
    15661566        'status'      => $attachment->post_status,
    15671567        'uploadedTo'  => $attachment->post_parent,
    1568         'date'        => $attachment->post_date_gmt . ' UTC',
    1569         'modified'    => $attachment->post_modified_gmt . ' UTC',
     1568        'date'        => strtotime( $attachment->post_date_gmt ) * 1000,
     1569        'modified'    => strtotime( $attachment->post_modified_gmt ) * 1000,
    15701570        'mime'        => $attachment->post_mime_type,
    15711571        'type'        => $type,
Note: See TracChangeset for help on using the changeset viewer.