So, I just created a new plugin and i've added capabilities, a new role, linked them all together, etc.. etc.. but for some reason I'm unable to access my own backend.
Error message is the generic
You do not have sufficient permissions to access this page.
Code to create the Menu on the backend
add_menu_page(
'FOO Profile', // Link Text
'Manage your FOO profile', // Title
'foo-profile', // Capability (rights)
'foo-profile', // Slug
[$this, 'renderFooProfile'] // Callback for Link
);
This link is VISIABLE to me inside the admin area. I did the following check just to verify on top of this:
var_dump(current_user_can('foo-profile')) => int(1)
Now once i click the link i get the above-mentioned error message.
The rendering is a simple hello world echo, so I doubt the error is to be found there either :S
public function renderFooProfile() { echo "Hello World"; }
Any pointers as to where I'd have to look would be greatly appreciated.
Gist of the whole class > https://gist.github.com/anonymous/b4f69e203630f447677b