发布时间:2020-09-17
WordPress 常用函数 / has_shortcode,
检查内容中是否含有指定的 Shortcode。
<?php if ( has_shortcode( $content, 'gallery' ) ) { } ?>
$content
(string) (required) 要检测的内容
Default: None
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
$tag
(string) (required) 指定的 Shortcode
Default: None
(Bool)
指定的 Shortcode 找的返回 true,否则 false。
Since 3.6.0
wp-includes/shortcodes.php.
全站搜索