bbp_get_form_option( string $option, string $default = '', bool $slug = false )

Return settings API option

Description

Parameters

$option

(string) (Required)

$default

(string) (Optional)

Default value: ''

$slug

(bool) (Optional)

Default value: false

Source

File: bp-forums/admin/settings.php

	function bbp_get_form_option( $option, $default = '', $slug = false ) {

		// Get the option and sanitize it
		$value = get_option( $option, $default );

		// Slug?
		if ( true === $slug ) {
			$value = esc_attr( apply_filters( 'editable_slug', $value ) );

		// Not a slug
		} else {
			$value = esc_attr( $value );
		}

		// Fallback to default
		if ( empty( $value ) )
			$value = $default;

		// Allow plugins to further filter the output
		return apply_filters( 'bbp_get_form_option', $value, $option );
	}

Changelog

Changelog
Version Description
bbPress (r3203) 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.