bp_core_get_root_option( string $option )

Get a root option.

Description

"Root options" are those that apply across an entire installation, and are fetched only a single time during a pageload and stored in buddypress()->site_options to prevent future lookups. See bp_core_get_root_options().

Parameters

$option

(Required) Name of the option key.

Return

(mixed) Value, if found.

Source

File: bp-core/bp-core-options.php

function bp_core_get_root_option( $option ) {
	$bp = buddypress();

	if ( ! isset( $bp->site_options ) ) {
		$bp->site_options = bp_core_get_root_options();
	}

	$value = '';
	if ( isset( $bp->site_options[ $option ] ) ) {
		$value = $bp->site_options[ $option ];
	}

	return $value;
}

Changelog

Changelog
Version Description
BuddyPress 2.3.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.