WordPress user capabilities

WordPress user roles

  • Super Admin - admin of the whole Network, can manage each site and everything in the Network
  • Administrator - can do everything
  • Editor - can create, edit and delete main items: pages, posts, comments, media
  • Author - can view other people's articles; create, edit and publish his own articles
  • Contributor - can view other people's articles; create, edit and send his own articles for approval before publish
  • Subscriber - can do nothing except of editing his own profile

Check user role:

<?php
if( current_user_can( 'administrator' ) ) {} // only if administrator
if( current_user_can( 'editor' ) ) {} // only if editor
if( current_user_can( 'author' ) ) {} // only if author
if( current_user_can( 'contributor' ) ) {} // only if contributor
if( current_user_can( 'subscriber' ) ) {} // only if subscriber
?>

Check if user is logged in:

<?php
if( is_user_logged_in() ) {}
?>

2 comments on “WordPress user capabilities

  1. Pingback: User Management | iphbergoyang's Blog

  2. Pingback: A ver que pasa ahora | Agenda Tobeefree

Submit comment

Allowed HTML tags: <a href="http://google.com">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>
quote
</blockquote>

Current ye@r *