Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/05/2015 06:18:13 PM (5 years ago)
Author:
boonebgorges
Message:

Introduce bp_core_get_root_option() and use throughout BP.

Previously, we referenced the $bp->site_options array directly. This causes
problems in cases where these options may be referenced before the array is
initially populated. bp_core_get_root_option() will fetch the requested
value from the array if it's been populated, and will populate it if it has not.

Fixes #6045.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-screens.php

    r9471 r9698  
    157157        // Finally, let's check the blog details, if the user wants a blog and blog creation is enabled
    158158        if ( isset( $_POST['signup_with_blog'] ) ) {
    159             $active_signup = $bp->site_options['registration'];
     159            $active_signup = bp_core_get_root_option( 'registration' );
    160160
    161161            if ( 'blog' == $active_signup || 'all' == $active_signup ) {
     
    197197
    198198            // No errors! Let's register those deets.
    199             $active_signup = !empty( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : '';
     199            $active_signup = bp_core_get_root_option( 'registration' );
    200200
    201201            if ( 'none' != $active_signup ) {
Note: See TracChangeset for help on using the changeset viewer.