WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru WPmentor - Ищем топовых специалистов по WordPress, чтобы помочь вам заработать
функция не описана

WP_Customize_Manager::_validate_header_video() WP 4.7.0

Callback for validating the header_video value.

Ensures that the selected video is less than 8MB and provides an error message.

Это метод класса: WP_Customize_Manager

Хуков нет.

Возвращает

Разное.

Использование

$WP_Customize_Manager = new WP_Customize_Manager();
$var = $WP_Customize_Manager->_validate_header_video( $validity, $value );
$validity(WP_Error) (обязательный)
$value(смешанный) (обязательный)

Список изменений

С версии 4.7.0 Введена.

Код WP Customize Manager:: validate header video: wp-includes/class-wp-customize-manager.php WP 5.4

<?php
public function _validate_header_video( $validity, $value ) {
	$video = get_attached_file( absint( $value ) );
	if ( $video ) {
		$size = filesize( $video );
		if ( $size > 8 * MB_IN_BYTES ) {
			$validity->add(
				'size_too_large',
				__( 'This video file is too large to use as a header video. Try a shorter video or optimize the compression settings and re-upload a file that is less than 8MB. Or, upload your video to YouTube and link it with the option below.' )
			);
		}
		if ( '.mp4' !== substr( $video, -4 ) && '.mov' !== substr( $video, -4 ) ) { // Check for .mp4 or .mov format, which (assuming h.264 encoding) are the only cross-browser-supported formats.
			$validity->add(
				'invalid_file_type',
				sprintf(
					/* translators: 1: .mp4, 2: .mov */
					__( 'Only %1$s or %2$s files may be used for header video. Please convert your video file and try again, or, upload your video to YouTube and link it with the option below.' ),
					'<code>.mp4</code>',
					'<code>.mov</code>'
				)
			);
		}
	}
	return $validity;
}