Nisi’s work blog

Nisi’s work blog – programing tips

Wordpress: get the role of the current user

  1. /* get the role of the current user */
  2. global $current_user, $wpdb;
  3. $var = $wpdb->prefix . ‘capabilities’;
  4. $caps = $current_user->$var;