User roles returning empty
-
After the plugin update to version 5.0.9, there’s been an issue related to the user role array which comes from the ‘wp_get_current_user()’ function. I am getting an empty array of user roles which is causing an error on my website.
This issue does not occur while using the plugin version 4.12.2. Would you be able to provide some additional information on why this might be happening?The below are the partial snippets of when I var_dump() the ‘wp_get_current_user()’.
Newer version of the plugin (5.0.9)
public $caps => array(2) { 'administrator' => bool(true) 'business_owner' => bool(true) } public $cap_key => string(15) "wp_capabilities" public $roles => array(0) { } public $allcaps => array(2) { 'administrator' => bool(true) 'business_owner' => bool(true) }
Older version of the plugin (4.12.2):
public $caps => array(2) { 'administrator' => bool(true) 'business_owner' => bool(true) } public $cap_key => string(15) "wp_capabilities" public $roles => array(2) { [0] => string(13) "administrator" [1] => string(14) "business_owner" }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘User roles returning empty’ is closed to new replies.