Make WordPress Core


Ignore:
Timestamp:
01/10/2019 01:31:52 AM (7 years ago)
Author:
desrosj
Message:

Media: Store audio creation date in meta.

In [41746], wp_get_media_creation_timestamp() was introduced to read the created timestamp for videos from getID3 in meta whenever possible. This information is useful separately from the dates on the file itself.

This adds the same support audio files by utilizing wp_get_media_creation_timestamp() in wp_read_audio_metadata().

Props blob folio, desrosj.
Fixes #42017.

File:
1 edited

Legend:

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

    r43642 r44528  
    33413341
    33423342/**
    3343  * Retrieve metadata from a audio file's ID3 tags
     3343 * Retrieve metadata from an audio file's ID3 tags.
    33443344 *
    33453345 * @since 3.6.0
     
    33833383    if ( ! empty( $data['playtime_string'] ) ) {
    33843384        $metadata['length_formatted'] = $data['playtime_string'];
     3385    }
     3386
     3387    if ( empty( $metadata['created_timestamp'] ) ) {
     3388        $created_timestamp = wp_get_media_creation_timestamp( $data );
     3389
     3390        if ( false !==  $created_timestamp ) {
     3391            $metadata['created_timestamp'] = $created_timestamp;
     3392        }
    33853393    }
    33863394
Note: See TracChangeset for help on using the changeset viewer.