Changeset 4299
- Timestamp:
- 11/02/2012 06:29:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/settings.php
r4281 r4299 134 134 135 135 // Allow global access (on multisite) 136 '_bbp_default_role' => array( 137 'title' => __( 'Default user role', 'bbpress' ), 138 'callback' => 'bbp_admin_setting_callback_default_role', 139 'sanitize_callback' => 'sanitize_text_field', 140 'args' => array() 141 ), 142 143 // Allow global access (on multisite) 136 144 '_bbp_allow_global_access' => array( 137 'title' => __( ' Default userrole', 'bbpress' ),145 'title' => __( 'Auto role', 'bbpress' ), 138 146 'callback' => 'bbp_admin_setting_callback_global_access', 139 147 'sanitize_callback' => 'intval', … … 485 493 */ 486 494 function bbp_admin_setting_callback_global_access() { 487 global $wp_roles; 488 489 // Load roles if not set 490 if ( ! isset( $wp_roles ) ) 491 $wp_roles = new WP_Roles(); 492 493 $default_role = $wp_roles->role_names[ get_option( 'default_role', 'subscriber' ) ]; ?> 495 ?> 494 496 495 497 <input id="_bbp_allow_global_access" name="_bbp_allow_global_access" type="checkbox" id="_bbp_allow_global_access" value="1" <?php checked( bbp_allow_global_access( false ) ); ?> /> 496 <label for="_bbp_allow_global_access"><?php printf( __( 'Automatically assign "%s" role to new, registered visitors.', 'bbpress' ), translate_user_role( $default_role ) ); ?></label> 497 498 <?php 498 <label for="_bbp_allow_global_access"><?php _e( 'Automatically assign default role to new, registered users upon visiting the site.', 'bbpress' ); ?></label> 499 500 <?php 501 } 502 503 /** 504 * Output forum role selector (for user edit) 505 * 506 * @since bbPress (r4284) 507 */ 508 function bbp_admin_setting_callback_default_role() { 509 510 $default_role = bbp_get_default_role(); ?> 511 512 <select name="_bbp_default_role" id="_bbp_default_role"> 513 514 <?php foreach ( bbp_get_editable_roles() as $role => $details ) : ?> 515 516 <option <?php selected( $default_role, $role ); ?> value="<?php echo esc_attr( $role ); ?>"><?php echo translate_user_role( $details['name'] ); ?></option> 517 518 <?php endforeach; ?> 519 520 </select> 521 522 <?php 499 523 } 500 524
Note: See TracChangeset
for help on using the changeset viewer.