From bc0cb365a3868f76af84f1d3c08c071010276298 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 20 Feb 2017 06:49:53 +0000 Subject: [PATCH] Customize: Introduce `get_header_video_url` filter for the return value of `get_header_video_url()`. Props sanket.parmar, celloexpressions, SergeyBiryukov. Merges [40045], [40086] to the 4.7 branch. Fixes #39512. Built from https://develop.svn.wordpress.org/branches/4.7@40087 git-svn-id: http://core.svn.wordpress.org/branches/4.7@40024 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 17 +++++++++++++---- wp-includes/version.php | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 84fdd23adb..78e044ab3c 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1337,15 +1337,24 @@ function get_header_video_url() { $id = absint( get_theme_mod( 'header_video' ) ); $url = esc_url( get_theme_mod( 'external_header_video' ) ); - if ( ! $id && ! $url ) { - return false; - } - if ( $id ) { // Get the file URL from the attachment ID. $url = wp_get_attachment_url( $id ); } + /** + * Filters the header video URL. + * + * @since 4.7.3 + * + * @param string $url Header video URL, if available. + */ + $url = apply_filters( 'get_header_video_url', $url ); + + if ( ! $id && ! $url ) { + return false; + } + return esc_url_raw( set_url_scheme( $url ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index f756cd5ab8..4464aca0aa 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7.3-alpha-40085'; +$wp_version = '4.7.3-alpha-40087'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.