Wordpress get_option检查做了一些事情

时间:2017-10-10 01:25:18

标签: php wordpress if-statement

您好我想测试wordpress中复选框的结果是真还是假

  if(checked(1, get_option('demo-checkbox'), true)){?>
      //do something...
  <?php } ?>

但是在前端我得到了意想不到的结果,并在html页面输出checked='checked'

1 个答案:

答案 0 :(得分:0)

没关系,这很容易

  if (get_option('demo-checkbox') === '1') {?>

由于