Did you ever figure this out? I am also looking for this.
No response yet. However, Kevin was on vacation a week or two ago. I plan to ping him this weekend, to see if he is around. He’s conscientious.
Also, FWIW, this particular topic is mentioned in his documentation as a work in progress.
Checking out his documentation/forum now. Thanks for the feedback fredhead!
What RS function(s) can be used to display content based on group assignment?
// substitute actual group ID here (id argument in edit links on User > Role Groups)
$group_id_in_question = 12;
global $current_user;
if ( isset( $current_user->groups[ $group_id_in_question ] ) ) {
// do stuff
}
Thanks for that kevinB. Will play with this on a site in progress
I tried the following in a php widget:
$group_id_in_question = 9;
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
if ( isset( $current_id->$group_id[ $group_id_in_question ] ) ) echo "www";
else
echo "hhh";
But hhh is shown so if statement does not work.
// substitute actual group ID here (id argument in edit links on User > Role Groups)
$group_id_in_question = 9;
global $current_user;
if ( isset( $current_user->groups[ $group_id_in_question ] ) ) {
echo "hhh";
}
Seems to work sometimes…. It just does not using the widget logic widget with the same code. Very odd. Will try again tomorrow
let me correct last statement.
<?php
// substitute actual group ID here (id argument in edit links on User > Role Groups)
$group_id_in_question = 9;
global $current_user;
if ( isset( $current_user->groups[ $group_id_in_question ] ) ) {
echo "hhh";
else
echo "Nope";
}
?>
Does not run either. Only the PHP widget title not part of the if else statement is shown. Neither the if nor the else echo is shown.