strip_shortcodes_tagnames
云策文档标注
概述
strip_shortcodes_tagnames 是一个 WordPress 过滤器,用于修改要从内容中移除的短代码标签列表。它允许开发者在执行 strip_shortcodes() 函数时自定义哪些短代码标签被排除。
关键要点
- 这是一个过滤器,用于调整 strip_shortcodes() 函数中要移除的短代码标签数组。
- 接受两个参数:$tags_to_remove(要移除的短代码标签数组)和 $content(内容字符串)。
- 在 WordPress 4.7.0 版本中引入。
代码示例
$tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content );
原文内容
Filters the list of shortcode tags to remove from the content.
Parameters
$tags_to_removearray-
Array of shortcode tags to remove.
$contentstring-
Content shortcodes are being removed from.
Source
$tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content );
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |