bbp_admin_setting_callback_show_on_root()

Include root slug setting field

Description

Source

File: bp-forums/admin/settings.php

951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
function bbp_admin_setting_callback_show_on_root() {
 
    // Current setting
    $show_on_root = bbp_show_on_root();
 
    // Options for forum root output
    $root_options = array(
        'forums' => array(
            'name' => __( 'Forum Index', 'buddyboss' )
        ),
        'topics' => array(
            'name' => __( 'Discussions by Last Post', 'buddyboss' )
        )
    ); ?>
 
    <select name="_bbp_show_on_root" id="_bbp_show_on_root" <?php bbp_maybe_admin_setting_disabled( '_bbp_show_on_root' ); ?>>
 
        <?php foreach ( $root_options as $option_id => $details ) : ?>
 
            <option <?php selected( $show_on_root, $option_id ); ?> value="<?php echo esc_attr( $option_id ); ?>"><?php echo esc_html( $details['name'] ); ?></option>
 
        <?php endforeach; ?>
 
    </select>
 
<?php
}

Changelog

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