Making WordPress.org


Ignore:
Timestamp:
09/02/2022 05:43:23 AM (3 years ago)
Author:
dd32
Message:

WordPress.TV: Preference the wptv uploaded original to the VideoPress original file.

Follow up to [12043], [12044].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-rest/wordpresstv-rest.php

    r12043 r12045  
    143143                    }
    144144
     145                    $attachment_url = $wptv->get_video_attachment_url( $post );
     146                    if ( $attachment_url ) {
     147                        $video['video']['original'] = $attachment_url;
     148                    }
     149
    145150                    if ( function_exists( 'find_all_videopress_shortcodes' ) ) {
    146151                        $post_videos = array_keys( find_all_videopress_shortcodes( $post->post_content ) );
     
    150155
    151156                            // Original uploaded file, may vary in format.
    152                             $video['video']['original'] = $api_data['original'];
     157                            if ( empty( $video['video']['original'] ) ) {
     158                                $video['video']['original'] = $api_data['original'];
     159                            }
    153160
    154161                            // Ogg - No longer generated as of May 2021
Note: See TracChangeset for help on using the changeset viewer.