钩子文档

is_header_video_active

💡 云策文档标注

概述

is_header_video_active 是一个 WordPress 过滤器,用于控制自定义头部视频在当前页面是否显示。它基于主题设置的回调函数或默认条件来评估视频的显示资格。

关键要点

  • 过滤器名称:is_header_video_active
  • 参数:$show_video(布尔值),表示是否应显示自定义头部视频
  • 返回值:取决于主题设置的回调函数;若无回调,默认返回 is_front_page() 的值
  • 引入版本:WordPress 4.7.0
  • 相关函数:is_header_video_active(),位于 wp-includes/theme.php

代码示例

return apply_filters( 'is_header_video_active', $show_video );

📄 原文内容

Filters whether the custom header video is eligible to show on the current page.

Parameters

$show_videobool
Whether the custom header video should be shown. Returns the value of the theme setting for the custom-header‘s video-active-callback.
If no callback is set, the default value is that of is_front_page().

Source

return apply_filters( 'is_header_video_active', $show_video );

Changelog

Version Description
4.7.0 Introduced.