Skip to:
Content

BuddyPress.org

Changeset 3728 for trunk/bp-loader.php


Ignore:
Timestamp:
01/18/2011 12:53:31 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Code normalization and whitespace clean-up. Introduce bp-core-deprecated.php. Introduce root_slug globals into components with directories, to help with WP page slugs. Fixes #2600. Optimus Props boonebgorges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r3713 r3728  
    3838    do_action( 'bp_core_loaded' );
    3939
    40     /* Activity Streams */
     40    // Activity Streams
    4141    if ( !isset( $bp_deactivated['bp-activity.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity.php') )
    4242        include( BP_PLUGIN_DIR . '/bp-activity.php' );
    4343
    44     /* Blog Tracking */
     44    // Blog Tracking
    4545    if ( !isset( $bp_deactivated['bp-blogs.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') )
    4646        include( BP_PLUGIN_DIR . '/bp-blogs.php' );
    4747
    48     /* bbPress Forum Integration */
     48    // bbPress Forum Integration
    4949    if ( !isset( $bp_deactivated['bp-forums.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums.php') )
    5050        include( BP_PLUGIN_DIR . '/bp-forums.php' );
    5151
    52     /* Friend Connections */
     52    // Friend Connections
    5353    if ( !isset( $bp_deactivated['bp-friends.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends.php') )
    5454        include( BP_PLUGIN_DIR . '/bp-friends.php' );
    5555
    56     /* Groups Support */
     56    // Groups Support
    5757    if ( !isset( $bp_deactivated['bp-groups.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups.php') )
    5858        include( BP_PLUGIN_DIR . '/bp-groups.php' );
    5959
    60     /* Private Messaging */
     60    // Private Messaging
    6161    if ( !isset( $bp_deactivated['bp-messages.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages.php') )
    6262        include( BP_PLUGIN_DIR . '/bp-messages.php' );
    6363
    64     /* Extended Profiles */
     64    // Extended Profiles
    6565    if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') )
    6666        include( BP_PLUGIN_DIR . '/bp-xprofile.php' );
     
    7070
    7171/**
    72 * bp_loaded()
    73 *
    74 * Allow dependent plugins and core actions to attach themselves in a safe way.
    75 *
    76 * See bp-core.php for the following core actions:
    77 *      - bp_init|bp_setup_globals|bp_setup_root_components|bp_setup_nav|bp_register_widgets
    78 */
     72 * Allow dependent plugins and core actions to attach themselves in a safe way.
     73 *
     74 * See bp-core.php for the following core actions:
     75 *      - bp_init|bp_setup_globals|bp_setup_root_components|bp_setup_nav|bp_register_widgets
     76 */
    7977function bp_loaded() {
    8078    do_action( 'bp_loaded' );
     
    8280
    8381/**
    84  * bp_core_get_site_options()
    85  *
    8682 * BuddyPress uses site options to store configuration settings. Many of these settings are needed
    8783 * at run time. Instead of fetching them all and adding many initial queries to each page load, let's fetch
     
    126122        $site_meta = $wpdb->get_results( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ({$meta_keys})" );
    127123
    128     $root_blog_meta_keys = "'" . implode( "','", (array)$root_blog_options ) ."'";
    129 
     124    $root_blog_meta_keys  = "'" . implode( "','", (array)$root_blog_options ) ."'";
    130125    $root_blog_meta_table = $wpdb->get_blog_prefix( BP_ROOT_BLOG ) . 'options';
    131     $root_blog_meta = $wpdb->get_results( $wpdb->prepare( "SELECT option_name AS name, option_value AS value FROM {$root_blog_meta_table} WHERE option_name IN ({$root_blog_meta_keys})" ) );
     126    $root_blog_meta       = $wpdb->get_results( $wpdb->prepare( "SELECT option_name AS name, option_value AS value FROM {$root_blog_meta_table} WHERE option_name IN ({$root_blog_meta_keys})" ) );
    132127
    133128    $site_options = array();
     
    141136}
    142137
    143 /* Activation Function */
     138// Activation Function
    144139function bp_loader_activate() {
    145     /* Force refresh theme roots. */
     140    // Force refresh theme roots.
    146141    delete_site_transient( 'theme_roots' );
    147142
    148     /* Switch the user to the new bp-default if they are using the old bp-default on activation. */
     143    // Switch the user to the new bp-default if they are using the old
     144    // bp-default on activation.
    149145    if ( 'bp-sn-parent' == get_blog_option( BP_ROOT_BLOG, 'template' ) && 'bp-default' == get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) )
    150146        switch_theme( 'bp-default', 'bp-default' );
     
    154150register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
    155151
    156 /* Deactivation Function */
     152// Deactivation Function
    157153function bp_loader_deactivate() {
    158154    do_action( 'bp_loader_deactivate' );
Note: See TracChangeset for help on using the changeset viewer.