Check if user is admin
-
There’s a place on my blog where I’d like to provide a link to admin for editing the site — and a link to something else for those without admin privileges. Right now, I’m using this (below). Is there a better way?
<?php if ( current_user_can('manage_options') ) { edit_post_link('Edit the site'); } else { print("Some content.");}?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Check if user is admin’ is closed to new replies.