WordPress.org

Ready to get started?Download WordPress

Forums

Groups
[resolved] Current User Capabilities (2 posts)

  1. thisislawatts
    Member
    Posted 1 year ago #

    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/

  2. itthinx
    Member
    Plugin Author

    Posted 1 year ago #

    Please have a look at the Groups plugin page, there are code examples in the comments related to that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.