钩子文档

wp_video_shortcode

💡 云策文档标注

概述

wp_video_shortcode 是一个 WordPress 过滤器,用于修改视频短码的 HTML 输出。它允许开发者自定义视频短码的渲染结果。

关键要点

  • 过滤器名称:wp_video_shortcode
  • 参数:$output(HTML 输出字符串)、$atts(属性数组)、$video(视频文件字符串)、$post_id(文章 ID 整数)、$library(媒体库字符串)
  • 返回值:通过 apply_filters 返回过滤后的输出
  • 相关函数:wp_video_shortcode() 用于构建视频短码输出
  • 引入版本:WordPress 3.6.0

📄 原文内容

Filters the output of the video shortcode.

Parameters

$outputstring
Video shortcode HTML output.
$attsarray
Array of video shortcode attributes.
$videostring
Video file.
$post_idint
Post ID.
$librarystring
Media library used for the video shortcode.

Source

return apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );

Changelog

Version Description
3.6.0 Introduced.