do_shortcode()
do_shortcode( string $content, bool $ignore_html = false )
搜索内容以查找短代码,并通过其钩子筛选短代码。
Search content for shortcodes and filter shortcodes through their hooks.
说明(Description)
如果没有定义快捷方式标记,则将返回内容而不进行任何筛选。当插件被禁用时,这可能会导致问题,但是短代码仍然会出现在文章或内容中。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$content | (string) | 必需 | 搜索快捷方式的内容。 |
$ignore_html | (bool) | 可选 | 如果为true,将跳过HTML元素中的快捷方式。 |
返回(Return)
(string)过滤掉了快捷方式的内容。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.5.0 | wp-includes/shortcodes.php:196 | 6 | 3 |
do_shortcode() 为WP2原创文章,链接:https://www.wp2.cn/functions/do_shortcode/