Powered by Blogger.

Check, Is admin logged in? In WordPress


Check, Is admin logged in? In WordPress

<?php global $user_ID; if( $user_ID ) : ?>
<?php if( current_user_can('level_10') ) : ?>

"Admin Dashboard"

<?php else : ?>

"Change Account Information"

<?php endif; ?>
<?php endif; ?>
My custom function:
function is_admin_logged_in(){
 
 global $user_ID; 
 
 if( $user_ID  && current_user_can('level_10') ) :
  
   
      return true;
    
     else : 
    
      return false;
    endif;
 
}

No comments