Hi.
I am using the "members" plugin Version 0.2 By Justin Tadlock and would like t be able to show which members have access to a specific page, by adding some code on that page.
Can anyone help me to achieve this?
THank you.
Hi.
I am using the "members" plugin Version 0.2 By Justin Tadlock and would like t be able to show which members have access to a specific page, by adding some code on that page.
Can anyone help me to achieve this?
THank you.
Hi. I got it to work. in case someone wanders, her's the code I am using (you need a plugin to allow php code on your page or widget text):
<?php
global $post;
global $wp_roles;
$roles = get_post_meta($post->ID, '_members_access_role', false );
if (empty ($roles)) {
echo "TUTTI";
}
else {
foreach ( $wp_roles->role_names as $role => $name )
{
if ( is_array( $roles ) && in_array( $role, $roles ) ){
echo '<p>', $name, '<br \>', '</p>';
}
}
}
?>You must log in to post.