钩子文档

embed_handler_html

💡 云策文档标注

概述

embed_handler_html 是一个 WordPress 过滤器钩子,用于修改嵌入处理程序返回的 HTML 内容。它允许开发者在嵌入短码执行后自定义输出。

关键要点

  • 这是一个过滤器钩子,用于过滤嵌入处理程序生成的 HTML 结果。
  • 接收三个参数:$return(短码的 HTML 结果)、$url(嵌入 URL)和 $attr(短码属性数组)。
  • 与 WP_Embed::shortcode() 和 WP_Embed::get_embed_handler_html() 相关。
  • 自 WordPress 2.9.0 版本引入。

📄 原文内容

Filters the returned embed HTML.

Description

See also

Parameters

$returnstring
The HTML result of the shortcode.
$urlstring
The embed URL.
$attrarray
An array of shortcode attributes.

Source

return apply_filters( 'embed_handler_html', $return, $url, $attr );

Changelog

Version Description
2.9.0 Introduced.