Skip to:
Content

BuddyPress.org

Changeset 3743 for trunk/bp-loader.php


Ignore:
Timestamp:
01/19/2011 08:52:40 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Introduce bp-core-hooks to assist in understanding load order. First initial move of actions to this new file with brief descriptions. More to do here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r3742 r3743  
    2020register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
    2121     
    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 
     23if ( !$bp_db_version = get_site_option( 'bp-db-version' ) )
    2524    $bp_db_version = get_site_option( 'bp-core-db-version' );  // BP 1.2 option name
    2625     
    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
     27if ( empty( $bp_db_version ) ) {
    2928    define( 'BP_IS_INSTALL', true );
    3029    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
     30   
     31// Existing successful installation
    3132} else {
    3233    /***
     
    3738    $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
    3839
     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     */
    3947    do_action( 'bp_core_loaded' );
    4048
     
    7785 * Custom Actions
    7886 *
    79  * Functions to set up custom BuddyPress actions that all other components can
     87 * Functions to set up custom BuddyPress actions that components should
    8088 * hook in to.
    8189 */
    8290
    8391/**
    84  * Allow plugins to include their files ahead of core filters
     92 * Include files on this action
    8593 */
    8694function bp_include() {
    8795    do_action( 'bp_include' );
    8896}
    89 add_action( 'bp_loaded', 'bp_include', 2 );
    9097
    9198/**
    92  * Allow core components and dependent plugins to set root components
     99 * Setup BuddyPress root directory components
    93100 */
    94101function bp_setup_root_components() {
    95102    do_action( 'bp_setup_root_components' );
    96103}
    97 add_action( 'bp_init', 'bp_setup_root_components', 2 );
    98104
    99105/**
    100  * Allow core components and dependent plugins to set globals
     106 * Setup global variables and objects
    101107 */
    102108function bp_setup_globals() {
    103109    do_action( 'bp_setup_globals' );
    104110}
    105 add_action( 'bp_init', 'bp_setup_globals', 6 );
    106111
    107112/**
    108  * Allow core components and dependent plugins to set their nav
     113 * Set navigation elements
    109114 */
    110115function bp_setup_nav() {
    111116    do_action( 'bp_setup_nav' );
    112117}
    113 add_action( 'bp_init', 'bp_setup_nav', 8 );
    114118
    115119/**
    116  * Allow core components and dependent plugins to register widgets
     120 * Register widgets
    117121 */
    118122function bp_setup_widgets() {
    119123    do_action( 'bp_register_widgets' );
    120124}
    121 add_action( 'bp_init', 'bp_setup_widgets', 8 );
    122125
    123126/**
    124  * Allow components to initialize themselves cleanly
     127 * Initlialize code
    125128 */
    126129function bp_init() {
    127130    do_action( 'bp_init' );
    128131}
    129 add_action( 'init', 'bp_init' );
    130132
    131133/**
     
    135137    do_action( 'bp_loaded' );
    136138}
    137 add_action( 'plugins_loaded', 'bp_loaded', 10 );
    138139
    139140/**
Note: See TracChangeset for help on using the changeset viewer.