Title: [Plugin: Widget Logic] Admin only widgets?
Last modified: August 19, 2016

---

# [Plugin: Widget Logic] Admin only widgets?

 *  [aces1](https://wordpress.org/support/users/aces1/)
 * (@aces1)
 * [18 years ago](https://wordpress.org/support/topic/plugin-widget-logic-admin-only-widgets/)
 * Is there a way of using the Widget Logic plugin to show a widget only for admin
   level users…

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

 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [18 years ago](https://wordpress.org/support/topic/plugin-widget-logic-admin-only-widgets/#post-778419)
 * you could use current_user_can(‘capability’)
 * i think capability can be an old fashioned admin level type integer or the more
   modern capabilities. have a look at
 * [http://codex.wordpress.org/Roles_and_Capabilities](http://codex.wordpress.org/Roles_and_Capabilities)
 *  Thread Starter [aces1](https://wordpress.org/support/users/aces1/)
 * (@aces1)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/plugin-widget-logic-admin-only-widgets/#post-778574)
 * I don’t see how…
 * The roles and capabilities seems to relate more to the admin panel and editing,
   not viewing pages..
 * It must be possible somehow….
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/plugin-widget-logic-admin-only-widgets/#post-778587)
 * nonetheless, the current_user_can function should work when displaying pages 
   and posts. current_user means the logged in ID.
 * i have used it to show extra post information viewable only by logged in site
   editors.
 * try it. make an admin and non-admin user, and just try adding some widget logic
   that uses that function.
 *  Thread Starter [aces1](https://wordpress.org/support/users/aces1/)
 * (@aces1)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/plugin-widget-logic-admin-only-widgets/#post-778592)
 * wow! it works….
 * had a look [here](http://www.bravenewcode.com/2008/05/02/how-to-show-content-for-specific-users-in-wordpress-templates/)
 * then just added _current\_user\_can(‘level\_10’)_ and it works…..
 * Thanks for your help!

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

The topic ‘[Plugin: Widget Logic] Admin only widgets?’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [aces1](https://wordpress.org/support/users/aces1/)
 * Last activity: [17 years, 12 months ago](https://wordpress.org/support/topic/plugin-widget-logic-admin-only-widgets/#post-778592)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
