发布时间:2020-09-17
WordPress 常用函数 / shortcode_parse_atts,
获取短代码的所有属性,获取到属性列表是属性名作为 key,属性值做为 value 的 key/value 对。这个函数用于更加容易获取属性,因为所有属性都必须已知。
<?php shortcode_parse_atts( $text ); ?>
$text
(string) (required) 短代码的所有属性的文本。
Default: None
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
(mixed)
属性和它的值的数组,或者一个字符串。
Since: 2.5
wp-includes/shortcodes.php
全站搜索