• Topfed

    (@stefan002377)


    Hello!

    Can someone help me, I do not find the solution, how to do In one example header.php file a menu will be different depending on groups

    Simple Exemple:

    if($usergroups == ‘Basic Group’) {
    Menu 1
    }
    if($usergroups == ‘Pro Group’) {
    Menu 2
    }

    How to find value at $usergroups a user logged in?

    Thank you for your time

    https://www.ads-software.com/plugins/groups/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi guy,

    According to the API provided by the plugin (doc here :https://api.itthinx.com/groups/package-groups.html), you have to do that :

    First, you have to create a Groups_User object :

    $groups_user = new Groups_User( get_current_user_id() );

    Then, you can get groups Array thanks to the groups attributes like this :

    $groups_of_my_user = $groups_user->groups

    Then $groups_of_my_user will be an array of groups object.

    I just started using this plugin, if you have others question, please ask, i’ll try to help you ??

    Hi guy,

    According to the API provided by the plugin (doc here :https://api.itthinx.com/groups/package-groups.html), you have to do that :

    First, you have to create a Groups_User object :

    $groups_user = new Groups_User( get_current_user_id() );

    Then, you can get groups Array thanks to the groups attributes like this :

    $groups_of_my_user = $groups_user->groups

    Then $groups_of_my_user will be an array of groups object.

    I just started using this plugin, if you have others question, please ask, i’ll try to help you ??

    Hi guy,

    According to the API provided by the plugin (doc here :https://api.itthinx.com/groups/package-groups.html), you have to do that :

    First, you have to create a Groups_User object :

    $groups_user = new Groups_User( get_current_user_id() );

    Then, you can get groups Array thanks to the groups attributes like this :

    $groups_of_my_user = $groups_user->groups

    Then $groups_of_my_user will be an array of groups object.

    I just started using this plugin, if you have others question, please ask, i’ll try to help you ??

    I tried this and it doesn’t work. There is no groups object property. What is $groups_user->groups return?

    Plugin Author Kento

    (@proaktion)

    Hi @howdy_mcgee,

    What @donfal71 has explained is correct. If you’d like to share the code you’re using, we can help you to correct it.

    Cheers

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to find the list of groups that a user is logged?’ is closed to new replies.