With wordpress, is there a statement like current_user_can except show something if a user does not

Posted by zac on Stack Overflow See other posts from Stack Overflow or by zac
Published on 2010-04-26T03:37:36Z Indexed on 2010/04/26 3:43 UTC
Read the original article Hit count: 263

Filed under:
|
|

I am trying to show a custom css depending on user permissions with a function like :

 <?php
if ( !current_user_can( 'install_themes' ) ) { ?>
<link media="all" type="text/css" href="<?php bloginfo( 'template_directory' ); ?>/library/styles/customAdmin.css" rel="stylesheet">
<?php }

Perhaps I am being dense about this but I want to do the reverse and show specific CSS if a user can not, in this case, install_themes. I am doing it this way because the css hides parts of the admin area that I do not want hidden globally. I could probably do this with liberal use of !important in my style sheetsbut I was hoping there was an easier way to write this in the function.

Or is there a way to write

<?php if ( current_user_can('level_7') ) : ?>

with something like if < level_7 ?

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about php