bp_pre_get_option( bool $value = false )

Filter default options and allow them to be overloaded from inside the $bp->options array.

Description

Parameters

$value

(Optional) Default value false.

Default value: false

Return

(mixed) False if not overloaded, mixed if set.

Source

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

function bp_pre_get_option( $value = false ) {
	$bp = buddypress();

	// Remove the filter prefix.
	$option = str_replace( 'pre_option_', '', current_filter() );

	// Check the options global for preset value.
	if ( ! empty( $bp->options[ $option ] ) ) {
		$value = $bp->options[ $option ];
	}

	// Always return a value, even if false.
	return $value;
}

Changelog

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