私有帮助函数用于选中,选中,禁用和只读。
原型
__checked_selected_helper( mixed $helper, mixed $current, bool $echo, string $type )
描述
比较前两个参数,如果相同的标记为$ type
参数
$helper
(mixed)
(Required)
要比较的值之一
$current
(mixed)
(Required)
(true)要比较的另一个值,如果不是真的
$echo
(bool)
(Required)
是回显还是只返回字符串
$type
(string)
(Required)
我们正在进行检查|选择|禁用的类型
返回值
(string)
html属性或空字符串
源文件
路径:wp-includes/general-template.php
<?php
...
function __checked_selected_helper( $helper, $current, $echo, $type ) {
if ( (string) $helper === (string) $current )
$result = " $type='$type'";
else
$result = '';
if ( $echo )
echo $result;
return $result;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/__checked_selected_helper/