bbp_admin_setting_callback_global_access

Allow global access setting field.

Description

bbp_admin_setting_callback_global_access(); 

Usage

  1. if ( !function_exists( 'bbp_admin_setting_callback_global_access' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/admin/settings.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_admin_setting_callback_global_access(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/settings.php  
  1. function bbp_admin_setting_callback_global_access() { 
  2.  
  3. // Get the default role once rather than loop repeatedly below 
  4. $default_role = bbp_get_default_role(); 
  5.  
  6. // Start the output buffer for the select dropdown 
  7. ob_start(); ?> 
  8.  
  9. </label> 
  10. <label for="_bbp_default_role"> 
  11. <select name="_bbp_default_role" id="_bbp_default_role" <?php bbp_maybe_admin_setting_disabled( '_bbp_default_role' ); ?>> 
  12. <?php foreach ( bbp_get_dynamic_roles() as $role => $details ) : ?> 
  13.  
  14. <option <?php selected( $default_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option> 
  15.  
  16. <?php endforeach; ?> 
  17. </select> 
  18.  
  19. <?php $select = ob_get_clean(); ?> 
  20.  
  21. <label for="_bbp_allow_global_access"> 
  22. <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' ); ?> /> 
  23. <?php printf( esc_html__( 'Automatically give registered visitors the %s forum role', bbpress ), $select ); ?> 
  24. </label> 
  25.  
  26. <?php