Changes between Initial Version and Version 1 of Ticket #39512, comment 7
- Timestamp:
- 01/21/2017 07:54:57 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #39512, comment 7
initial v1 4 4 5 5 But putting the filter in `get_header_video_url` would also make `the_header_video_url` work as expected, so the filter really does belong on `get_header_video_url`, but it will require new logic for the attachment vs external video source to make a filter work. 6 7 Maybe like this? 8 9 {{{ 10 11 function get_header_video_url() { 12 $id = absint( get_theme_mod( 'header_video' ) ); 13 $url = esc_url( get_theme_mod( 'external_header_video' ) ); 14 15 //if ( ! $id && ! $url ) { 16 // return false; 17 //} 18 19 if ( $id ) { 20 // Get the file URL from the attachment ID. 21 $url = wp_get_attachment_url( $id ); 22 } 23 $url = apply_filters('get_header_video_url', $url); 24 if ( ! $url ) 25 return false; 26 return esc_url_raw( set_url_scheme( $url ) ); 27 } 28 }}}