Display users of a group

Home Forums Premium add-ons support Display users of a group

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #711619
    danibirdcom
    Participant

    Hello,

    Expected Behavior
    I want to display the users in a group on a page. For example: If user “A” is the Manager of group “1”, he would want user “A” to see all the users in group “1” but only from that group that he is the manager.


    {write here…}

    Current Behavior
    I do not know how to do it.


    1. WordPress version: 5.4.1/li]
    2. WP Customer Area version: 7.8.6

    3. Related add-ons versions:
      WP Customer Area – Managed Groups version: 4.1.0
    4. WP Customer Area – ACF Integration version 5.0.0
    5. WP Customer Area – Owner Restriction version 4.1.1
    #711998
    Thomas Lartaud
    Keymaster

    Hi,

    Not tested, but I think it might help.

    You can add this function to your theme functions.php file.

    /**
     * Get the real user ids behind the logical owner of the post
     *
     * @param int  $post_id
     *
     * @return mixed
     */
    function cuar_get_the_owner_user_ids( $post_id = 0 ) {
        /** @var CUAR_PostOwnerAddOn $po_addon */
        $po_addon = cuar_addon( 'post-owner' );
    
        $post_id = $post_id==0 ? get_the_ID() : $post_id;
        $owner_ids = $po_addon->get_post_owner_user_ids( $post_id );
    
        return apply_filters( 'cuar/private-content/the-owner-ids', $owner_ids, $post_id );
    }

    This function will return an array of user IDs belonging to the post.
    I’m not sure if this is really what you are looking for. Maybe you are just trying to fetch users from a given group ID, which might be a bit different.

    Regards.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.