Created
July 13, 2017 09:05
-
-
Save pranali333/c92dea38d3d997075b694b4ef28e767e to your computer and use it in GitHub Desktop.
List media from the groups of which a currently logged-in user is a member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * It will first identify that currently logged-in user is member of which group and pick up the first group | |
| * if there are more than one. | |
| **/ | |
| $user_id = get_current_user_id(); | |
| $user_groups = (groups_get_user_groups($user_id)); | |
| $user_groups = $user_groups["groups"]; | |
| echo do_shortcode('[rtmedia_gallery media_type="music" context="group" context_id="'.$user_groups[0].'"]'); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment