Changeset 10356 for trunk/src/bp-core/bp-core-loader.php
- Timestamp:
- 11/15/2015 07:57:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-loader.php
r10108 r10356 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 /** 15 * Creates the Core component. 16 */ 14 17 class BP_Core extends BP_Component { 15 18 … … 51 54 do_action( 'bp_core_loaded' ); 52 55 53 /** Components ********************************************************/ 56 /** Components ******************************************************* 57 */ 54 58 55 59 /** … … 71 75 $bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) ); 72 76 73 // Get a list of activated components 77 // Get a list of activated components. 74 78 if ( $active_components = bp_get_option( 'bp-active-components' ) ) { 75 79 … … 86 90 $bp->deactivated_components = apply_filters( 'bp_deactivated_components', array_values( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_keys( $bp->active_components ) ) ) ); 87 91 88 // Pre 1.5 Backwards compatibility 92 // Pre 1.5 Backwards compatibility. 89 93 } elseif ( $deactivated_components = bp_get_option( 'bp-deactivated-components' ) ) { 90 94 91 // Trim off namespace and filename 95 // Trim off namespace and filename. 92 96 foreach ( array_keys( (array) $deactivated_components ) as $component ) { 93 97 $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) ); … … 97 101 $bp->deactivated_components = apply_filters( 'bp_deactivated_components', $trimmed ); 98 102 99 // Setup the active components 103 // Setup the active components. 100 104 $active_components = array_fill_keys( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ), '1' ); 101 105 … … 103 107 $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components ); 104 108 105 // Default to all components active 109 // Default to all components active. 106 110 } else { 107 111 108 // Set globals 112 // Set globals. 109 113 $bp->deactivated_components = array(); 110 114 111 // Setup the active components 115 // Setup the active components. 112 116 $active_components = array_fill_keys( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), '1' ); 113 117 … … 116 120 } 117 121 118 // Loop through optional components 122 // Loop through optional components. 119 123 foreach( $bp->optional_components as $component ) { 120 124 if ( bp_is_active( $component ) && file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { … … 123 127 } 124 128 125 // Loop through required components 129 // Loop through required components. 126 130 foreach( $bp->required_components as $component ) { 127 131 if ( file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { … … 130 134 } 131 135 132 // Add Core to required components 136 // Add Core to required components. 133 137 $bp->required_components[] = 'core'; 134 138 … … 176 180 $bp = buddypress(); 177 181 178 /** Database **********************************************************/ 179 180 // Get the base database prefix 182 /** Database ********************************************************* 183 */ 184 185 // Get the base database prefix. 181 186 if ( empty( $bp->table_prefix ) ) { 182 187 $bp->table_prefix = bp_core_get_table_prefix(); 183 188 } 184 189 185 // The domain for the root of the site where the main blog resides 190 // The domain for the root of the site where the main blog resides. 186 191 if ( empty( $bp->root_domain ) ) { 187 192 $bp->root_domain = bp_core_get_root_domain(); 188 193 } 189 194 190 // Fetches all of the core BuddyPress settings in one fell swoop 195 // Fetches all of the core BuddyPress settings in one fell swoop. 191 196 if ( empty( $bp->site_options ) ) { 192 197 $bp->site_options = bp_core_get_root_options(); 193 198 } 194 199 195 // The names of the core WordPress pages used to display BuddyPress content 200 // The names of the core WordPress pages used to display BuddyPress content. 196 201 if ( empty( $bp->pages ) ) { 197 202 $bp->pages = bp_core_get_directory_pages(); 198 203 } 199 204 200 /** Basic current user data *******************************************/ 201 202 // Logged in user is the 'current_user' 205 /** Basic current user data ****************************************** 206 */ 207 208 // Logged in user is the 'current_user'. 203 209 $current_user = wp_get_current_user(); 204 210 … … 207 213 $bp->loggedin_user->id = isset( $current_user->ID ) ? $current_user->ID : 0; 208 214 209 /** Avatars ***********************************************************/ 210 211 // Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar 215 /** Avatars ********************************************************** 216 */ 217 218 // Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar. 212 219 $bp->grav_default = new stdClass; 213 220 … … 271 278 public function setup_cache_groups() { 272 279 273 // Global groups 280 // Global groups. 274 281 wp_cache_add_global_groups( array( 275 282 'bp'
Note: See TracChangeset
for help on using the changeset viewer.