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

Return settings API option

Description

Parameters

$option

(Required)

$default

(Optional)

Default value: ''

$slug

(Optional)

Default value: false

Source

File: bp-forums/admin/settings.php

1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
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.