1. 首页
  2. WordPress钩子手册

embed_oembed_html

apply_filters( ’embed_oembed_html’, string|false $cache, string $url, array $attr, int $post_ID )

过滤器::过滤缓存的oEmbed HTML。
Filter Hook: Filters the cached oEmbed HTML.

目录锚点:#说明#参数#源码#笔记


说明(Description)

另见函数 WP_Embed::shortcode()()


参数(Parameters)

参数 类型 说明
$cache (string | false) 缓存的HTML结果,存储在post meta中。
$url (string) 尝试嵌入的URL。
$attr (array) 一组快捷方式属性。
$post_ID (int) 邮政编码。

源码(Source)


更新版本 源码位置 使用 被使用
2.9.0 wp-includes/class-wp-embed.php:256 1 0

笔记(Notes)

请注意https://developer.wordpress.org/reference/hooks/embed_oembed_html/#注释-1964年非常错误地假设每个oEmbed响应都包含一个视频,甚至更不正确的假设提高了对每个oEmbed响应具有相同纵横比的期望。
将oEmbed包装在div中。例如,可用于使视频响应。

embed_oembed_html 为WP2原创文章,链接:https://www.wp2.cn/hook/embed_oembed_html/