Skip to content

Commit

Permalink
Alignments; remove unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Nov 3, 2024
1 parent ec25233 commit b8ce81a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/wp-conference-schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -1706,22 +1706,20 @@ function wpcs_get_captions() {
* @return string
*/
function wpcs_get_asl() {
$cache_break = ( current_user_can( 'manage_options' ) ) ? true : false;
$post_id = get_the_ID();
$asl = '';
$filename = get_post_field( 'post_name', $post_id );
$year = gmdate( 'Y', strtotime( get_option( 'wpad_start_time' ) ) );
$post_id = get_the_ID();
$asl = '';
$filename = get_post_field( 'post_name', $post_id );
$year = gmdate( 'Y', strtotime( get_option( 'wpad_start_time' ) ) );
// 2024 is the first year we did this. Exit early if earlier than 2024.
if ( absint( $year ) < 2024 ) {
return $asl;
}
$filepath = plugin_dir_path( __FILE__ ) . 'assets/asl/' . $year . '/' . $filename . '.mp4';
$file_url = plugins_url( '/assets/asl/' . $year . '/' . $filename . '.mp4', __FILE__ );
$filepath = plugin_dir_path( __FILE__ ) . 'assets/asl/' . $year . '/' . $filename . '.mp4';
global $wp_filesystem;
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
if ( $wp_filesystem->exists( $filepath ) ) {
$asl = ( $cache_break ) ? add_query_arg( 'version', wp_rand( 10000, 99999 ), $file_url ) : $file_url;
$asl = str_replace( '/home/wp/www/2024', '', $filepath );
}

return $asl;
Expand Down

0 comments on commit b8ce81a

Please sign in to comment.