checked()

checked()函数是Wordpress函数,输出html checked属性。

checked( mixed $checked, mixed $current = true, bool $echo = true )

说明(Description)

比较前两个参数,如果选中相同的标记


参数(Parameters)

参数类型必填说明
$checked(mixed)必需要比较的值之一
$current(mixed)可选(true)要比较的另一个值(如果不只是true)
$echo(bool)可选是回显还是返回字符串

返回(Return)

(string)html属性或空string


源码(Source)

/**
 * Outputs the html checked attribute.
 *
 * Compares the first two arguments and if identical marks as checked
 *
 * @since 1.0.0
 *
 * @param mixed $checked 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 checked( $checked, $current = true, $echo = true ) {
	return __checked_selected_helper( $checked, $current, $echo, 'checked' );
}
更新版本源码位置使用被使用
1.0.0wp-includes/general-template.php:4638301 function

笔记(Notes)

暂无

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索