Created
April 8, 2015 22:04
-
-
Save herrbischoff/f94a73473472f397646a to your computer and use it in GitHub Desktop.
Show WordPress Content By User Level
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
<?php if (current_user_can('level_10')) : ?> | |
<?php print "control the world"; ?> | |
<?php elseif (current_user_can('level_7')) : ?> | |
<?php print "edit, write, publish, delete, read, comment"; ?> | |
<?php elseif (current_user_can('level_4')) : ?> | |
<?php print "write, publish, delete, read, comment"; ?> | |
<?php elseif (current_user_can('level_2')) : ?> | |
<?php print "write, read, comment"; ?> | |
<?php elseif (current_user_can('level_0')) : ?> | |
<?php print "read and comment"; ?> | |
<?php else : ?> | |
<?php print "you gotta log-in to see the goodies"; ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment