Title: php code to hide something
Last modified: August 18, 2016

---

# php code to hide something

 *  [harry07](https://wordpress.org/support/users/harry07/)
 * (@harry07)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/php-code-to-hide-something/)
 * `<?php $nummod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved
   = '0'");
    if (0 < $nummod) $nummod = number_format($nummod); ?>
 * <b>In Moderation:</b> <?php echo $nummod ?> [...](https://wordpress.org/support/topic/php-code-to-hide-something/wp-admin/moderation.php?output_format=md)
 * The above code is in my sidebar.php which will display the count of comments 
   that are awaiting moderation. but i don’t want the reading public to see it. 
   i want it to be displayed if the user is logged in.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/php-code-to-hide-something/#post-293401)
 * Could you use something like this:
    `global $user_ID; get_currentuserinfo();  
   if ('' != $user_ID) echo $nummod;
 *  [hep](https://wordpress.org/support/users/hep/)
 * (@hep)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/php-code-to-hide-something/#post-293402)
 * I used the same code and it worked
 *  Thread Starter [harry07](https://wordpress.org/support/users/harry07/)
 * (@harry07)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/php-code-to-hide-something/#post-293461)
 * thanks for the help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘php code to hide something’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [harry07](https://wordpress.org/support/users/harry07/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/php-code-to-hide-something/#post-293461)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
