bp_pre_get_option( bool $value = false )

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


Description Description


Parameters Parameters

$value

(Optional) Default value false.

Default value: false


Top ↑

Return Return

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


Top ↑

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

Top ↑

Changelog Changelog

Changelog
Version Description
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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