title: if current_user_can() function 500 error
body: <p>I' trying to write a function that will hide the admin bar for certain users. I'm borrowing some code from the hide admin bar plugin. I've written the following which results in a server error: </p>
  
  <pre><code>&lt;?php
  /*Hides the Admin Bar in WordPress 3.1+
  Tweaked Hide Admin Bar plugin */
  
  if (  current_user_can('moderate_comments')  ) {
      function hide_admin_bar_prefs() {
          ?&gt;
  
          &lt;style type="text/css"&gt;
              .show-admin-bar {display: none;}
          &lt;/style&gt; 
  
      &lt;?php 
      }
  
      add_action( 'admin_print_scripts-profile.php', 'hide_admin_bar_prefs' );
      add_filter( 'show_admin_bar', '__return_false' );
  }
  
  ?&gt;
  </code></pre>
  
  <p>If I change the if statement to a true or false equation, it works properly. For instance if I use </p>
  
  <pre><code>if (1 == 1) {... 
  or 
  if (1 == 2) {... 
  </code></pre>
  
  <p>it works as I would expect. What am I missing?</p>