【发布时间】:2013-08-05 14:43:05
【问题描述】:
我有一个复选框,其默认状态为未选中:
<?php
function edit_theme_settings() {
if ( get_option('sold_text') == true ) { $display = 'checked'; }
else { $display = ''; }
update_option( 'sold_text', $display );
?>
<input type="checkbox" name="sold_text" id="sold_text" <?php echo get_option('sold_text'); ?> />
我希望在第一次显示表单时将其默认状态设为未选中,随后它的“已选中”状态应由 get_option('sold_text') 定义。
【问题讨论】:
-
和函数
get_option()? -
get_option() 呢?