bp_get_option( string $option_name, string $default = '' )

Retrieve an option.

Description

This is a wrapper for get_blog_option(), which in turn stores settings data (such as bp-pages) on the appropriate blog, given your current setup.

The ‘bp_get_option’ filter is primarily for backward-compatibility.

Parameters

$option_name

(string) (Required) The option to be retrieved.

$default

(string) (Optional) Default value to be returned if the option isn't set. See get_blog_option().

Default value: ''

Return

(mixed) The value for the option.

Source

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

function bp_get_option( $option_name, $default = '' ) {
	$value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );

	/**
	 * Filters the option value for the requested option.
	 *
	 * @since BuddyPress 1.5.0
	 *
	 * @param mixed $value The value for the option.
	 */
	return apply_filters( 'bp_get_option', $value );
}

Changelog

Changelog
Version Description
BuddyPress 1.5.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.