I’ve added a role of “Customer” and I am working on customizing the Users Screen for that role. What I’d like to do is customize columns based on that particular role.
Note:
For example, take a look at the screenshot. How would I remove the reference to the posts column for only the customer role?
Manage Columns
It’s pretty straight forward using the
manage_{post-type-name}_columns
filter: Just switch per$capability
and unset what you don’t need in the$post_columns
array.Add a column
Thanks to Mike23 for the tip. Here’s the code that I’m using to add a column to only the “customer” role:
Any ideas or suggestions for improvement are very welcomed.
Have a look at current_user_can. With that you can filter your code by roles, and then do whatever you want to customize the interface.
Quick and dirty, with CSS. Put this in your functions.php :