钩子文档

oembed_response_data

💡 云策文档标注

概述

oembed_response_data 是一个 WordPress 过滤器,用于修改 oEmbed 响应数据。它允许开发者在返回 oEmbed 数据前进行自定义处理。

关键要点

  • 过滤器名称:oembed_response_data
  • 参数:$data(响应数据数组)、$post(WP_Post 对象)、$width(请求宽度)、$height(计算高度)
  • 相关函数:get_oembed_response_data() 用于获取 oEmbed 响应数据
  • 引入版本:WordPress 4.4.0

📄 原文内容

Filters the oEmbed response data.

Parameters

$dataarray
The response data.
$postWP_Post
The post object.
$widthint
The requested width.
$heightint
The calculated height.

Source

return apply_filters( 'oembed_response_data', $data, $post, $width, $height );

Changelog

Version Description
4.4.0 Introduced.