wp_readonly

函式
wp_readonly ( $readonly, $current = true, $echo = true )
引數
  • (mixed) $readonly 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.
定義位置
相關方法
readonlywp_headwp_cronwp_rand_wp_cron
引入
5.9.0
棄用
-

wp_readonly。這個WordPress函式用於將一個表單元素標記為只讀,以防止使用者修改其值。它生成必要的HTML程式碼,將該元素顯示為只讀。

輸出HTML只讀屬性。

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

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

常見問題

FAQs
檢視更多 >