bp_core_get_root_option( string $option )

Get a root option.


Description 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 Parameters

$option

(Required) Name of the option key.


Top ↑

Return Return

(mixed) Value, if found.


Top ↑

Source 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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.