Hi
Love the plugin however we are working on a bit of customisation.
We use Memberships plugin to control memberships and under peoples name in comments if they have an active membership we would like it to say "Active Member"
I can use something like this to test if they have an active membership
Β
$memberships = wc_memberships_get_user_active_memberships( $user_id );
if ( ! empty( $memberships ) ) {
// do something for this active member
echo 'Active';
}
else {
echo 'Inactive';
}
Β
Is there a hook to intercept where the commenters name etc is? any idea? would appreciate it!
Or actually is there a hook for under the avatar?
Β
I think something like this should work but im not sure of the right hook
Β
add_filter('wpdiscuz_after_label', 'wpdiscuz_mem_after_label_html', 110, 2);
function wpdiscuz_mem_after_label_html($afterLabelHtml, $comment) {
$memberships = wc_memberships_get_user_active_memberships( $user_id );
if ( ! empty( $memberships ) ) {
// do something for this active member
//echo 'Active';
$afterLabelHtml .= 'Mega Mystic Member';
}
else {
//echo 'Inactive';
}
return $afterLabelHtml;
}