bbp_admin_setting_callback_global_access
Allow global access setting field.
Description
bbp_admin_setting_callback_global_access();
Usage
if ( !function_exists( 'bbp_admin_setting_callback_global_access' ) ) { require_once ABSPATH . PLUGINDIR . 'bbpress/includes/admin/settings.php'; } // NOTICE! Understand what this does before running. $result = bbp_admin_setting_callback_global_access();
Defined (1)
The function is defined in the following location(s).
- /includes/admin/settings.php
- function bbp_admin_setting_callback_global_access() {
- // Get the default role once rather than loop repeatedly below
- $default_role = bbp_get_default_role();
- // Start the output buffer for the select dropdown
- ob_start(); ?>
- </label>
- <label for="_bbp_default_role">
- <select name="_bbp_default_role" id="_bbp_default_role" <?php bbp_maybe_admin_setting_disabled( '_bbp_default_role' ); ?>>
- <?php foreach ( bbp_get_dynamic_roles() as $role => $details ) : ?>
- <option <?php selected( $default_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option>
- <?php endforeach; ?>
- </select>
- <?php $select = ob_get_clean(); ?>
- <label for="_bbp_allow_global_access">
- <input name="_bbp_allow_global_access" id="_bbp_allow_global_access" type="checkbox" value="1" <?php checked( bbp_allow_global_access( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_global_access' ); ?> />
- <?php printf( esc_html__( 'Automatically give registered visitors the %s forum role', bbpress ), $select ); ?>
- </label>
- <?php