Title: Widget for admin only
Last modified: August 22, 2016

---

# Widget for admin only

 *  Resolved [Conarchcpl](https://wordpress.org/support/users/conarchcpl/)
 * (@conarchcpl)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/widget-for-admin-only/)
 * Is there an easy way to display this widget so it only show’s when an admin is
   logged in? I was really just looking for something in the dashboard to tell me
   this information and this seems to be the best option so far.
 * [https://wordpress.org/plugins/wp-postviews/](https://wordpress.org/plugins/wp-postviews/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/widget-for-admin-only/#post-5831023)
 * Maybe add this after Line 10 [https://github.com/lesterchan/wp-useronline/blob/master/widget.php#L10](https://github.com/lesterchan/wp-useronline/blob/master/widget.php#L10)
 *     ```
       if ( ! current_user_can( 'manage_options' ) )
           return;
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Widget for admin only’ is closed to new replies.

 * ![](https://ps.w.org/wp-postviews/assets/icon.svg?rev=978002)
 * [WP-PostViews](https://wordpress.org/plugins/wp-postviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-postviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-postviews/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-postviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-postviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-postviews/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/widget-for-admin-only/#post-5831023)
 * Status: resolved