[buddypress-trac] [BuddyPress Trac] #6045: $bp->site_options should not be referenced directly

buddypress-trac noreply at wordpress.org
Wed Nov 26 14:38:52 UTC 2014


#6045: $bp->site_options should not be referenced directly
--------------------------+----------------------------------------
 Reporter:  boonebgorges  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  2.2
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:  good-first-bug needs-patch
--------------------------+----------------------------------------
 Currently, we use `$bp->site_options` as storage for some networkwide
 values that are expensive to look up on the fly. We load these values in
 `BP_Core_Component::setup_globals()`. But there are cases where BuddyPress
 needs access to these values before they've been filled, such as
 `bp_get_signup_allowed()`. See #6043.

 The solution is to have a wrapper function for accessing these site
 options, and then to use that wrapper whenever referencing them. Inside
 the function, load the site_options with `bp_core_get_root_options()` if
 they're not yet loaded into `$bp->site_option`. Then, be sure to use this
 wrapper whenever calling the options.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6045>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list