Changeset 3736 for trunk/bp-core.php
- Timestamp:
- 01/18/2011 10:46:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r3734 r3736 44 44 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php' ); 45 45 46 // Register BuddyPress themes contained within the bp-theme folder47 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );48 49 46 /** "And now for something completely different" ******************************/ 50 47 … … 208 205 * These can be overridden manually by defining these slugs in wp-config.php. 209 206 * 207 * The fallback values are only used during initial BP page creation, when no slugs have been 208 * explicitly defined. 209 * 210 210 * @package BuddyPress Core Core 211 211 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() … … 216 216 if ( !defined( 'BP_MEMBERS_SLUG' ) ) 217 217 define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug ); 218 218 219 219 if ( !defined( 'BP_REGISTER_SLUG' ) ) 220 220 define( 'BP_REGISTER_SLUG', $bp->pages->register->slug ); 221 221 222 222 if ( !defined( 'BP_ACTIVATION_SLUG' ) ) 223 223 define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug ); 224 224 225 } 225 226 add_action( 'bp_setup_globals', 'bp_core_define_slugs' ); … … 258 259 $page_ids = bp_core_get_page_meta(); 259 260 260 if ( empty( $page_ids ) ) 261 return false; 261 $pages = new stdClass; 262 263 // When upgrading to BP 1.3+ from a version of BP that does not use WP pages, $bp->pages 264 // must be populated with dummy info to avoid crashing the site while the db is upgraded 265 if ( empty( $page_ids ) ) { 266 $dummy_components = array( 267 'members', 268 'groups', 269 'activity', 270 'forums', 271 'activate', 272 'register', 273 'blogs' 274 ); 275 276 foreach ( $dummy_components as $dc ) { 277 $pages->{$dc}->name = $dc; 278 $pages->{$dc}->slug = $dc; 279 $pages->{$dc}->id = $dc; 280 } 281 282 return $pages; 283 } 262 284 263 285 $posts_table_name = is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ? $wpdb->get_blog_prefix( BP_ROOT_BLOG ) . 'posts' : $wpdb->posts; … … 266 288 267 289 $page_names = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) " ) ); 268 $pages = new stdClass;269 290 270 291 foreach ( (array)$page_ids as $key => $page_id ) { … … 348 369 if ( !is_super_admin() ) 349 370 return false; 371 372 // Don't add this version of the admin menu if a BP upgrade is in progress 373 // See bp_core_update_add_admin_menu() 374 if ( defined( 'BP_IS_UPGRADE' ) && BP_IS_UPGRADE ) 375 return false; 350 376 351 377 // Add the administration tab under the "Site Admin" tab for site administrators
Note: See TracChangeset
for help on using the changeset viewer.