hide text from users of a certain role
-
I want to make it so users who are contributors see certain information, but users who are subscribers do not see the information. In other words, I want the text to be conditional based on the logged-in user.
I can do this with styles, showing and hiding based on conditions. For example:
<?php
if ( current_user_can('contributor') ) {echo '<style>';
echo '.internal {display:normal;}';
echo '</style>';
}elseif (current_user_can('subscriber')) {
echo '<style>';
echo '.internal {display:none;}';
echo '</style>';
}?>
However, if you look in the source, a subscriber can still see the hidden text.
How do I remove code from even being processed server side?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘hide text from users of a certain role’ is closed to new replies.