检索标题视频设置。

原型

get_header_video_settings()

返回值

(array)  

源文件

路径:wp-includes/theme.php

<?php
...
function get_header_video_settings() {
	$header     = get_custom_header();
	$video_url  = get_header_video_url();
	$video_type = wp_check_filetype( $video_url, wp_get_mime_types() );
	$settings = array(
		'mimeType'  => '',
		'posterUrl' => get_header_image(),
		'videoUrl'  => $video_url,
		'width'     => absint( $header->width ),
		'height'    => absint( $header->height ),
		'minWidth'  => 900,
		'minHeight' => 500,
		'l10n'      => array(
			'pause'      => __( 'Pause' ),
			'play'       => __( 'Play' ),
			'pauseSpeak' => __( 'Video is paused.'),
			'playSpeak'  => __( 'Video is playing.'),
		),
	);
	if ( preg_match( '#^https?://(?:www.)?(?:youtube.com/watch|youtu.be/)#', $video_url ) ) {
		$settings['mimeType'] = 'video/x-youtube';
	} elseif ( ! empty( $video_type['type'] ) ) {
		$settings['mimeType'] = $video_type['type'];
	}
	return apply_filters( 'header_video_settings', $settings );
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/get_header_video_settings/