^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 8年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云2核2g仅需86元/年

wordpress函数get_header_video_settings()用法示例

get_header_video_settings()

Retrieve header video settings.


描述


返回值

(array)

新用户2核2g仅需86元/年    领取1153套模板    免费cdn流量包    ¥3188礼包


源代码

File: wp-includes/theme.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 );
}

更新日志

Version 描述
4.7.0 Introduced.

相关函数

Uses

  • wp-includes/theme.php:
    get_header_video_url()
  • wp-includes/theme.php:
    get_custom_header()
  • wp-includes/theme.php:
    get_header_image()
  • wp-includes/l10n.php:
    __()
  • wp-includes/functions.php:
    absint()
  • wp-includes/functions.php:
    wp_check_filetype()
  • wp-includes/functions.php:
    wp_get_mime_types()
  • wp-includes/plugin.php:
    apply_filters()
  • Show 3 more uses


Used By

  • wp-includes/class-wp-customize-manager.php:
    WP_Customize_Manager::export_header_video_settings()
  • wp-includes/theme.php:
    the_custom_header_markup()

让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈