[buddypress-trac] [BuddyPress Trac] #7658: Use WP functions to retrieve current user ID.

buddypress-trac noreply at wordpress.org
Wed Jan 17 18:51:58 UTC 2018


#7658: Use WP functions to retrieve current user ID.
--------------------------+------------------------------
 Reporter:  dcavins       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Core          |     Version:  2.9.2
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by johnjamesjacoby):

 I've thought about this a lot, and these types of multisite work-arounds
 do come back as problems frequently.

 I forget if BuddyPress does anything to the `current_user` and
 `displayed_user` objects that's different from core WordPress `WP_User`
 objects, but I think the answer is yes.

 * If not, we should switch everything to use the current `WP_User` object-
 based functions, and add `__get()` magic support when something tries to
 look at `$bp->current_user`
 * If BuddyPress does modify the object, we need to decide if we keep
 supporting it in perpetuity, and/or if we are more comfortable modifying
 the current `WP_User` object directly instead

 ----

 The REST downgrade is interesting in that I think the point was always
 that those two user objects be clones of one-another, so however that
 variable is being nerfed, it should be bubbling back up to
 `$bp->current_user`, I would have assumed.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7658#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list