钩子文档

image_add_caption_shortcode

💡 云策文档标注

概述

image_add_caption_shortcode 是一个 WordPress 过滤器,用于修改包含标题短代码的图像 HTML 标记。它允许开发者在图像标记生成时进行自定义处理。

关键要点

  • 过滤器名称:image_add_caption_shortcode
  • 参数:$shcode(包含标题短代码的图像 HTML 标记)和 $html(原始图像 HTML 标记)
  • 返回值:应用过滤器后的图像标记
  • 相关函数:image_add_caption(),用于向编辑器添加带标题的图像短代码
  • 引入版本:WordPress 2.6.0

代码示例

return apply_filters( 'image_add_caption_shortcode', $shcode, $html );

📄 原文内容

Filters the image HTML markup including the caption shortcode.

Parameters

$shcodestring
The image HTML markup with caption shortcode.
$htmlstring
The image HTML markup.

Source

return apply_filters( 'image_add_caption_shortcode', $shcode, $html );

Changelog

Version Description
2.6.0 Introduced.