WordPress.org

Forums

Edit Flow
[resolved] retrieve usergroup (5 posts)

  1. phracktale
    Member
    Posted 3 years ago #

    Hi,

    I try to retrieve edit_flow specific group from an user in functions.php of my theme.

    global $current_user, $edit_flow;
    $usergroup = $edit_flow->user_groups->get_usergroups_for_user($current_user->ID);

    Doesn't work.

    in get_usergroups_for_user function from module/user-groups.php
    This var : $all_usergroups is empty.

    What is wrong please ?

    http://wordpress.org/extend/plugins/edit-flow/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    Could you describe more how you're using this code? It might be related to this thread.

    Also $usergroup != $all_usergroups, so please double-check your code.

  3. mogmismo
    Member
    Posted 3 years ago #

    I'll second that, $all_usergroups is empty when called directly, as phracktale is calling it.

    I'm trying this to list the groups on a frontend contributor template, such as:

    John Doe is a photographer, editor and writer for our site.

    I'd like a way, from frontend templates, to get, as an array, the groups that a user is in. Kind of like the iterater in coauthors plus, if possible. I've verified that I'm sending the user's ID (as a number) to get_usersgroups_for_user(), but $all_usergroups (in line 1040ish) is var_dumping as:

    array(2) { [0]=> bool(false) [1]=> bool(false) }

    thanks,

    M.

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    I've flagged this as an issue to fix

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    This should be doable now in v0.7.4

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Edit Flow
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic