checked

函式
checked ( $checked, $current = true, $echo = true )
引數
  • (mixed) $checked One of the values to compare.
    Required:
  • (mixed) $current Optional. The other value to compare if not just true. Default true.
    Required:
    Default: true
  • (bool) $echo Optional. Whether to echo or just return the string. Default true.
    Required:
    Default: true
返回值
  • (string) HTML attribute or empty string.
定義位置
相關方法
wp_checkdatexfn_checkcheck_commentfetch_feedcheck_column
引入
1.0.0
棄用
-

checked: 這個函式生成一個HTML屬性,在表單中使用,表示一個覈取方塊是否應該被選中。

輸出HTML checked屬性。

比較前兩個引數,如果相同則標記為選中。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function checked( $checked, $current = true, $echo = true ) {
return __checked_selected_helper( $checked, $current, $echo, 'checked' );
}
function checked( $checked, $current = true, $echo = true ) { return __checked_selected_helper( $checked, $current, $echo, 'checked' ); }
function checked( $checked, $current = true, $echo = true ) {
	return __checked_selected_helper( $checked, $current, $echo, 'checked' );
}

常見問題

FAQs
檢視更多 >