apply_shortcodes

函数
apply_shortcodes ( $content, $ignore_html = false )
参数
  • (string) $content Content to search for shortcodes.
    Required:
  • (bool) $ignore_html When true, shortcodes inside HTML elements will be skipped. Default false.
    Required:
    Default: false
返回值
  • (string) Content with shortcodes filtered out.
相关
  • do_shortcode()
定义位置
相关方法
gallery_shortcodeadd_shortcodewp_playlist_shortcodehas_shortcodestrip_shortcodes
引入
5.4.0
弃用
-

apply_shortcodes: 这个函数用于解析和执行给定字符串中的短代码。它需要一个参数,也就是要解析的字符串。开发人员可以使用这个函数将动态内容添加到文章、页面和其他内容类型。

为短代码搜索内容,并通过其钩子过滤短代码。

这个函数是do_shortcode()的一个别名。

function apply_shortcodes( $content, $ignore_html = false ) {
	return do_shortcode( $content, $ignore_html );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-06 11:33:17

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: