Title: Current User Capabilities
Last modified: August 20, 2016

---

# Current User Capabilities

 *  Resolved [thisislawatts](https://wordpress.org/support/users/thisislawatts/)
 * (@thisislawatts)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/current-user-capabilities/)
 * Heya,
 * I am looking at putting together a query for posts that the current user has 
   access to. So my thought process was that first I’d have to establish current
   user’s capabilities then build a WP_Query off of that. However I seem to be stuck
   at the first hurdle with $user->__get(‘capabilities’) returning NULL.
 * Is there any reason this would be happening/better way to query the posts.
 *     ```
       $user_id = get_current_user_id();
       $user = new Groups_User($user_id);
       $groups = $user->__get('groups');
   
       // Get Current user capabilities
       $caps = $user->__get('capabilities');
       ```
   
 * [http://wordpress.org/extend/plugins/groups/](http://wordpress.org/extend/plugins/groups/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [itthinx](https://wordpress.org/support/users/itthinx/)
 * (@itthinx)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/current-user-capabilities/#post-3271610)
 * Please have a look at the [Groups](http://www.itthinx.com/plugins/groups/) plugin
   page, there are code examples in the comments related to that.

Viewing 1 replies (of 1 total)

The topic ‘Current User Capabilities’ is closed to new replies.

 * ![](https://ps.w.org/groups/assets/icon-256x256.png?rev=983146)
 * [Groups](https://wordpress.org/plugins/groups/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/groups/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/groups/)
 * [Active Topics](https://wordpress.org/support/plugin/groups/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/groups/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/groups/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [itthinx](https://wordpress.org/support/users/itthinx/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/current-user-capabilities/#post-3271610)
 * Status: resolved