[英]WordPress Plugin - Checkbox Undefined Index if not checked
我有一個復選框,如果沒有選中它顯示“未定義的索引”我在這里搜索我發現了一些類似的答案,但我無法使其工作。
這是我打印復選框輸入的方式
printf(
'<input type="checkbox" id="custom_conversion_enable" name="conversion_settings_option_custom[custom_conversion_enable]" value="1" '. checked( 1, $this->options_custom['custom_conversion_enable'], false ) .' />',
isset( $this->options_custom['custom_conversion_enable'] ) ? esc_attr( $this->options_custom['custom_conversion_enable']) : ''
);
Key是一個字符串,需要將其作為字符串發送回php。
name="conversion_settings_option_custom['custom_conversion_enable']"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.