Tag Info

Hot answers tagged

1

I think best hook should be 'template_redirect', when this hook is fired main query is already set, so you can look at queried object and if the user has no required capability you can redirect request somewhere: add_action( 'template_redirect', function() { if ( ( is_category( 'special-category' ) || is_singular() && has_category( ...


1

You can try with current_user_can() function. Step: if( ! current_user_can('manage_sites')){ // SHOW THE LOPGIN TOP BAR }


1

You could use something like this if you have jquery included in your page: <?php if ( is_super_admin() ) { ?> <script type="text/javascript"> $( document ).ready(function() { $("#IDofDivHoldingUserTopBar").css("display", "none"); // ID of user top bar // ............................. OR ...



Only top voted, non community-wiki answers of a minimum length are eligible