shortcode_exists

函数
shortcode_exists ( $tag )
参数
  • (string) $tag Shortcode tag to check.
    Required:
返回值
  • (bool) Whether the given shortcode exists.
定义位置
相关方法
shortcode_attsshortcode_parse_attsget_shortcode_regexdo_shortcode_tagpost_exists
引入
3.6.0
弃用
-

shortcode_exists: 这是一个WordPress函数,用于检查一个给定的短码是否存在。它通常被用来确定一个短码是否可以在一个特定的环境中使用: 这个函数需要一个参数,就是短码的名称。

确定是否存在一个名为$tag的注册短码。

function shortcode_exists( $tag ) {
	global $shortcode_tags;
	return array_key_exists( $tag, $shortcode_tags );
}

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-15 02:36:46

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

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

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