我有一个复选框,其默认状态为未选中:WordPress的设置页面,如何默认复选框的状态来检查?
<?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()'? – 2013-08-04 21:18:48
get_option()呢? – Andy