My client has purchased a poorly written Plugin which meets their needs pretty well, but leaves me with needing to do so additional coding.
I have had difficulty finding an answer in the documentation - so I thought I'd just ask the "smart people" here for help. Thanks in advance for your assistance with this!
The plugin was hard-coded to only appear as a menu option for WP users with the "Administrator" role. My clients never get a role higher than Editor as there are a lot of things I don't want them touching. I'm the only Administrator!
So the key to my being able to modify the code is to grab the user's role, then IF ( the role is editor or administrator ) ... include the plugin in to the menu.
They're using:
add_menu_page('PrayBox','PrayBox+','administrator','pb_settings','pb_settings_page',plugins_url().'/praybox-plus/images/favicon.png');
... to display the plugin on the menu. I would like to substitute the user's role for a hard-coded 'administrator' when passing the parameters to this function.
How do I obtain the current user's role?
PLEASE DON'T TELL ME ABOUT A PLUGIN TO ASSIGN USER ROLES / CAPABILITIES. I have already tried several of those without success - the way to fix this is in the plugin code ... period. Thank you!