Making WordPress.org

Changeset 12041


Ignore:
Timestamp:
09/02/2022 05:00:44 AM (18 months ago)
Author:
dd32
Message:

WordPress.TV: Allow re uploading subtitles.

This open-sources changes made by robfelty upstream in the WordPress.TV codebase.

Props robfelty.
Fixes #1207.

Location:
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2
Files:
2 edited

Legend:

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

    r8230 r12041  
    149149        if ( ! $parent || ! in_array( $parent->post_status, array( 'publish', 'private' ), true ) ) {
    150150            wp_die( 'You can not subtitle this video.' );
    151         }
    152 
    153         $tracks = class_exists( 'VideoPress_Subtitles' ) ? VideoPress_Subtitles::get_tracks( $video_data->guid ) : array();
    154         if ( ! empty( $tracks[ $language['key'] ] ) ) {
    155             $this->error( 8 );
    156151        }
    157152
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/upload-subtitles-template.php

    r8365 r12041  
    277277                            <?php $tracks = VideoPress_Subtitles::get_tracks( $video->guid ); ?>
    278278                            <?php foreach ( VideoPress_Subtitles::get_languages() as $value => $language ) : ?>
    279                                 <option value="<?php echo esc_attr( $value ); ?>" <?php disabled( ! empty( $tracks[ $value ] ) ); ?> ><?php echo esc_html( $language['localized_label'] ); ?></option>
     279                                <option value="<?php echo esc_attr( $value ); ?>" ><?php echo esc_html( $language['localized_label'] ); ?></option>
    280280                            <?php endforeach; ?>
    281281                        </select>
Note: See TracChangeset for help on using the changeset viewer.