Skip to content

Commit

Permalink
deploy: 8623f90
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Sep 18, 2024
1 parent 4430470 commit f0ad762
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions wp-conference-schedule.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -1693,18 +1693,16 @@
$captions = array();
$has_caption = false;
foreach ( $languages as $key => $language ) {
if ( 'en' === $key ) {
$filename = get_post_field( 'post_name', $post_id ) . '-' . $key;
$year = gmdate( 'Y', strtotime( get_option( 'wpad_start_time' ) ) );
$filepath = plugin_dir_path( __FILE__ ) . 'assets/captions/' . $year . '/' . $filename . '.vtt';
$file_url = plugins_url( '/assets/captions/' . $year . '/' . $filename . '.vtt', __FILE__ );
global $wp_filesystem;
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
if ( $wp_filesystem->exists( $filepath ) ) {
$has_caption = ( 'en' === $key ) ? true : $has_caption;
$captions[ $key ] = $file_url;
}
$filename = get_post_field( 'post_name', $post_id ) . '-' . $key;
$year = gmdate( 'Y', strtotime( get_option( 'wpad_start_time' ) ) );
$filepath = plugin_dir_path( __FILE__ ) . 'assets/captions/' . $year . '/' . $filename . '.vtt';
$file_url = plugins_url( '/assets/captions/' . $year . '/' . $filename . '.vtt', __FILE__ );
global $wp_filesystem;
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
if ( $wp_filesystem->exists( $filepath ) ) {
$has_caption = ( 'en' === $key ) ? true : $has_caption;
$captions[ $key ] = $file_url;
}
}
// We only display videos if they have English captions, first. Translations are secondary.
Expand Down

0 comments on commit f0ad762

Please sign in to comment.