diff --git a/src/js/_enqueues/wp/custom-header.js b/src/js/_enqueues/wp/custom-header.js
index ae43f56174..eae8f12227 100644
a
|
b
|
|
390 | 390 | height: this.settings.height, |
391 | 391 | width: this.settings.width, |
392 | 392 | videoId: this.settings.videoUrl.match( VIDEO_ID_REGEX )[1], |
| 393 | host: location.protocol + ( ( this.settings.videoUrl.indexOf( 'youtube-nocookie' ) !== -1 ) ? '//www.youtube-nocookie.com' : '//www.youtube.com' ), |
393 | 394 | events: { |
394 | 395 | onReady: function( e ) { |
395 | 396 | e.target.mute(); |
diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php
index 3b3259c573..ff2c05c557 100644
a
|
b
|
final class WP_Customize_Manager { |
6081 | 6081 | public function _validate_external_header_video( $validity, $value ) { |
6082 | 6082 | $video = sanitize_url( $value ); |
6083 | 6083 | if ( $video ) { |
6084 | | if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video ) ) { |
| 6084 | if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube(?:-nocookie)?\.com/(?:watch|embed)|youtu\.be/)#', $video ) ) { |
6085 | 6085 | $validity->add( 'invalid_url', __( 'Please enter a valid YouTube URL.' ) ); |
6086 | 6086 | } |
6087 | 6087 | } |
diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
index 3c7b297b2a..0e6d37300a 100644
a
|
b
|
function get_header_video_settings() { |
1647 | 1647 | ), |
1648 | 1648 | ); |
1649 | 1649 | |
1650 | | if ( preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video_url ) ) { |
| 1650 | if ( preg_match( '#^https?://(?:www\.)?(?:youtube(?:-nocookie)?\.com/(?:watch|embed)|youtu\.be/)#', $video_url ) ) { |
1651 | 1651 | $settings['mimeType'] = 'video/x-youtube'; |
1652 | 1652 | } elseif ( ! empty( $video_type['type'] ) ) { |
1653 | 1653 | $settings['mimeType'] = $video_type['type']; |