Changeset 3743 for trunk/bp-loader.php
- Timestamp:
- 01/19/2011 08:52:40 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-loader.php
r3742 r3743 20 20 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' ); 21 21 22 // Test to see whether this is a new installation or an upgraded version of BuddyPress 23 $bp_db_version = get_site_option( 'bp-db-version' ); 24 if ( ! $bp_db_version ) 22 // Test to see whether this is a new installation or an upgraded version of BuddyPress 23 if ( !$bp_db_version = get_site_option( 'bp-db-version' ) ) 25 24 $bp_db_version = get_site_option( 'bp-core-db-version' ); // BP 1.2 option name 26 25 27 if ( ! $bp_db_version ) { 28 // This is a new installation. Run the wizard before loading BP core files 26 // This is a new installation. Run the wizard before loading BP core files 27 if ( empty( $bp_db_version ) ) { 29 28 define( 'BP_IS_INSTALL', true ); 30 29 require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' ); 30 31 // Existing successful installation 31 32 } else { 32 33 /*** … … 37 38 $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) ); 38 39 40 /** 41 * At this point in the stack, BuddyPress core has been loaded but 42 * individual components (friends/activity/groups/etc...) have not. 43 * 44 * The 'bp_core_loaded' action lets you execute code ahead of the 45 * other components. 46 */ 39 47 do_action( 'bp_core_loaded' ); 40 48 … … 77 85 * Custom Actions 78 86 * 79 * Functions to set up custom BuddyPress actions that all other components can87 * Functions to set up custom BuddyPress actions that components should 80 88 * hook in to. 81 89 */ 82 90 83 91 /** 84 * Allow plugins to include their files ahead of core filters92 * Include files on this action 85 93 */ 86 94 function bp_include() { 87 95 do_action( 'bp_include' ); 88 96 } 89 add_action( 'bp_loaded', 'bp_include', 2 );90 97 91 98 /** 92 * Allow core components and dependent plugins to set rootcomponents99 * Setup BuddyPress root directory components 93 100 */ 94 101 function bp_setup_root_components() { 95 102 do_action( 'bp_setup_root_components' ); 96 103 } 97 add_action( 'bp_init', 'bp_setup_root_components', 2 );98 104 99 105 /** 100 * Allow core components and dependent plugins to set globals106 * Setup global variables and objects 101 107 */ 102 108 function bp_setup_globals() { 103 109 do_action( 'bp_setup_globals' ); 104 110 } 105 add_action( 'bp_init', 'bp_setup_globals', 6 );106 111 107 112 /** 108 * Allow core components and dependent plugins to set their nav113 * Set navigation elements 109 114 */ 110 115 function bp_setup_nav() { 111 116 do_action( 'bp_setup_nav' ); 112 117 } 113 add_action( 'bp_init', 'bp_setup_nav', 8 );114 118 115 119 /** 116 * Allow core components and dependent plugins to register widgets120 * Register widgets 117 121 */ 118 122 function bp_setup_widgets() { 119 123 do_action( 'bp_register_widgets' ); 120 124 } 121 add_action( 'bp_init', 'bp_setup_widgets', 8 );122 125 123 126 /** 124 * Allow components to initialize themselves cleanly127 * Initlialize code 125 128 */ 126 129 function bp_init() { 127 130 do_action( 'bp_init' ); 128 131 } 129 add_action( 'init', 'bp_init' );130 132 131 133 /** … … 135 137 do_action( 'bp_loaded' ); 136 138 } 137 add_action( 'plugins_loaded', 'bp_loaded', 10 );138 139 139 140 /**
Note: See TracChangeset
for help on using the changeset viewer.