Changeset 6118 for trunk/src/bbpress.php
- Timestamp:
- 11/09/2016 09:51:11 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/bbpress.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bbpress.php
r6092 r6118 67 67 * @var array Topic views 68 68 */ 69 public $views = array();69 public $views = array(); 70 70 71 71 /** 72 72 * @var array Overloads get_option() 73 73 */ 74 public $options = array();74 public $options = array(); 75 75 76 76 /** … … 78 78 */ 79 79 public $user_options = array(); 80 81 /** 82 * @var array Dynamically initialized user roles 83 */ 84 public $roles = array(); 80 85 81 86 /** Singleton *************************************************************/ … … 316 321 require $this->includes_dir . 'common/functions.php'; 317 322 require $this->includes_dir . 'common/formatting.php'; 323 require $this->includes_dir . 'common/locale.php'; 318 324 require $this->includes_dir . 'common/template.php'; 319 325 require $this->includes_dir . 'common/widgets.php'; … … 383 389 'setup_theme', // Setup the default theme compat 384 390 'setup_current_user', // Setup currently logged in user 391 'roles_init', // User roles init 385 392 'register_post_types', // Register post types (forum|topic|reply) 386 393 'register_post_statuses', // Register post statuses (closed|spam|orphan|hidden) … … 745 752 * Setup the currently logged-in user 746 753 * 747 * Do not to call this prematurely, I.E. before the 'init' action has748 * started. This function is naturally hooked into 'init' to ensure proper749 * execution. get_currentuserinfo() is used to check for XMLRPC_REQUEST to750 * avoid xmlrpc errors.751 *752 754 * @since 2.0.0 bbPress (r2697) 753 755 * … … 756 758 public function setup_current_user() { 757 759 $this->current_user = wp_get_current_user(); 760 } 761 762 /** 763 * Initialize forum-specific roles 764 * 765 * @since 2.6.0 766 */ 767 public function roles_init() { 768 769 // Get role IDs 770 $keymaster = bbp_get_keymaster_role(); 771 $moderator = bbp_get_moderator_role(); 772 $participant = bbp_get_participant_role(); 773 $spectator = bbp_get_spectator_role(); 774 $blocked = bbp_get_blocked_role(); 775 776 // Build the roles into one useful array 777 $this->roles[ $keymaster ] = new WP_Role( 'Keymaster', bbp_get_caps_for_role( $keymaster ) ); 778 $this->roles[ $moderator ] = new WP_Role( 'Moderator', bbp_get_caps_for_role( $moderator ) ); 779 $this->roles[ $participant ] = new WP_Role( 'Participant', bbp_get_caps_for_role( $participant ) ); 780 $this->roles[ $spectator ] = new WP_Role( 'Spectator', bbp_get_caps_for_role( $spectator ) ); 781 $this->roles[ $blocked ] = new WP_Role( 'Blocked', bbp_get_caps_for_role( $blocked ) ); 758 782 } 759 783
Note: See TracChangeset
for help on using the changeset viewer.