函数原型
checked( mixed $checked, mixed $current = true, bool $echo = true ): string
函数描述
Outputs the HTML checked attribute.
是否弃用
未弃用
函数参数
-
$checked
mixed
Required - One of the values to compare.
-
$current
mixed
Optional - The other value to compare if not just true.
Default:
true -
$echo
bool
Optional - Whether to echo or just return the string.
Default:
true
函数返回值
string HTML attribute or empty string.
函数位置
File: wp-includes/general-template.php.
函数源码
function checked( $checked, $current = true, $echo = true ) {
return __checked_selected_helper( $checked, $current, $echo, 'checked' );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |

