protected function isAdmin() : bool {
$check = current_user_can('administrator');
return $check;
// returns false as I am logged in as superadmin, refreshing the page for xdebug to run
}
$check
also evaluates to false when using current_user_can('delete_site');
My wordpress install is hosted on my local machine, Lubuntu 18.04 with apache2. Php 7.2. I can access the site by navigating to http://localhost/folderName
in Google Chrome.
I have cookie auth enabled and see my user cookie is present with the EditThisCookie Chrome extension.
In the xdebug console (of Phpstorm 2019.2) I also get a false response:
current_user_can('delete_site');
false
current_user_can('administrator');
false
I have no issues navigating around the front or back end of the wordpress site as an Admin. I feel like this might be an environment issue due to the discrepency betwen the Chrome experience and what the plugin and Xdebug are catching.
Does anyone know why I am running into this issue?
rest_api_init
– Sean D Sep 2 '19 at 11:25