[wp-trac] [WordPress Trac] #43577: On multisite, fetch the current user via wp_get_current_user() returns empty roles array

WordPress Trac noreply at wordpress.org
Mon Mar 19 17:08:34 UTC 2018


#43577: On multisite, fetch the current user via wp_get_current_user() returns
empty roles array
--------------------------+-----------------------------
 Reporter:  bretweinraub  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.9.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 $user = wp_get_current_user();

 var_dump($user->{'roles'});

 ... prints

 {}

 Works fine in the root site, but in the subsite, roles is blank.

 In the site console, all the role functionality works fine.   All plugins
 are disabled, and I've confirmed that the roles array is blank in a simple
 page template.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43577>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list