getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
634 stars 95 forks source link

[Panels] Different Panel(s) for different User Role #148

Open leonard-ramen opened 7 years ago

leonard-ramen commented 7 years ago

Is there a way to determine the User role on panels.php? It seems that the function like wp_get_current_user() is not wokring on my end. For now I'm using is_admin(), here's a sample code

namespace Ppd;

/** @var \Herbert\Framework\Panel $panel */

if(is_admin()) {
  // ... Admin Panels
}
else {
  // ... Other Panels
}

I'm trying to display specific panels/views for specific User Roles, which I created on activate.php using the add_role() function but the different panel is not showing also, but that's another problem.