title: Default check a checkbox html
body: <p>I am trying to get a checkbox checked by default, but everything I have tried doesn't seem to work. I don't know if it has to do with the PHP that is in the code. </p>
  
  <pre><code>function show_subscription_checkbox ($id='0') {
      global $sg_subscribe;
      sg_subscribe_start();
  
      if ( $sg_subscribe-&gt;checkbox_shown ) return $id;
      if ( !$email = $sg_subscribe-&gt;current_viewer_subscription_status() ) :
          $checked_status = ( !empty($_COOKIE['subscribe_checkbox_'.COOKIEHASH]) &amp;&amp; 'checked' == $_COOKIE['subscribe_checkbox_'.COOKIEHASH] ) ? true : false;
      ?&gt;   
  &lt;p &lt;?php if ($sg_subscribe-&gt;clear_both) echo 'style="clear: both;" '; ?&gt;class="subscribe-to-comments"&gt;
          &lt;input type="checkbox" name="subscribe" id="subscribe" value="subscribe" style="width: auto;" &lt;?php if ( $checked_status ) echo 'checked="checked" '; ?&gt;/&gt;
  
          &lt;label for="subscribe"&gt;&lt;?php echo $sg_subscribe-&gt;not_subscribed_text; ?&gt;&lt;/label&gt;
          &lt;/p&gt;
  </code></pre>
  
  <p>This is a wordpress plugin that allows you to subscribe to blog comments.</p>
  
  <p>I have tried </p>
  
  <pre><code>echo 'checked=\"checked\" ';
  echo 'checked="checked" ' ;
  echo 'checked&gt; ';
  </code></pre>
  
  <p>The plugin author states that you used to be able to default check the checkbox but not anymore.</p>