selected()
selected( mixed $selected, mixed $current = true, bool …
selected( mixed $selected, mixed $current = true, bool $echo = true )
输出html选定属性。
Outputs the html selected attribute.
目录锚点:#说明#参数#源码#笔记
说明(Description)
比较前两个参数,如果选定的标记相同
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $selected | (mixed) | 要比较的值之一 |
| $current | (mixed) | (true)要比较的其他值(如果不只是true) |
| $echo | (bool) | 是回显还是只返回字符串 |
源码(Source)
/**
* Outputs the html selected attribute.
*
* Compares the first two arguments and if identical marks as selected
*
* @since 1.0.0
*
* @param mixed $selected One of the values to compare
* @param mixed $current (true) The other value to compare if not just true
* @param bool $echo Whether to echo or just return the string
* @return string html attribute or empty string
*/
function selected( $selected, $current = true, $echo = true ) {
return __checked_selected_helper( $selected, $current, $echo, 'selected' );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.0.0 | wp-includes/general-template.php | 13 | 10 |
笔记(Notes)
例子
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!