Created
August 8, 2018 23:08
-
-
Save geotsiokos/e7d9d72f3789f7a131c518e52815cbd1 to your computer and use it in GitHub Desktop.
This file contains 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
add_action( 'woocommerce_after_account_downloads', 'example_woocommerce_after_account_downloads' ); | |
function example_woocommerce_after_account_downloads() { | |
if ( | |
class_exists( 'Groups_Group' ) && | |
class_exists( 'Groups_User_Group' ) | |
) { | |
$group_ids = Groups_Group::get_group_ids(); | |
$user_id = get_current_user_id(); | |
foreach ( $group_ids as $group_id ) { | |
if ( Groups_User_Group::read( $user_id, $group_id ) ) { | |
$group = Groups_Group::read( $group_id ); | |
if ( $group ) { | |
echo '<p>'; | |
echo 'You have access to ' . $group->name; | |
echo '</p>'; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment