Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/05/2015 06:18:13 PM (10 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-xprofile/bp-xprofile-loader.php

    r9676 r9698  
    9696        // Defined conditionally to accommodate unit tests
    9797        if ( ! defined( 'BP_XPROFILE_BASE_GROUP_NAME' ) ) {
    98             define( 'BP_XPROFILE_BASE_GROUP_NAME', stripslashes( $bp->site_options['bp-xprofile-base-group-name'] ) );
     98            define( 'BP_XPROFILE_BASE_GROUP_NAME', stripslashes( bp_core_get_root_option( 'avatar_default' ) ) );
    9999        }
    100100
    101101        if ( ! defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) ) {
    102             define( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ) );
     102            define( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( bp_core_get_root_option( 'bp-xprofile-fullname-field-name' ) ) );
    103103        }
    104104
Note: See TracChangeset for help on using the changeset viewer.