WordPress at a glance
function is not described

WP_Customize_Manager::_validate_external_header_video() public WP 4.7.0

Callback for validating the external_header_video value.

Ensures that the provided URL is supported.

{} It's a method of the class: WP_Customize_Manager{}

No Hooks.

Return

Mixed.

Usage

$WP_Customize_Manager = new WP_Customize_Manager();
$WP_Customize_Manager->_validate_external_header_video( $validity, $value );
$validity(WP_Error) (required)
-
$value(mixed) (required)
-

Changelog

Since 4.7.0 Introduced.

Code of WP_Customize_Manager::_validate_external_header_video() WP 5.7.2

<?php
public function _validate_external_header_video( $validity, $value ) {
	$video = esc_url_raw( $value );
	if ( $video ) {
		if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video ) ) {
			$validity->add( 'invalid_url', __( 'Please enter a valid YouTube URL.' ) );
		}
	}
	return $validity;
}