Skip to:
Content

BuddyPress.org

Changeset 3946 for trunk/bp-loader.php


Ignore:
Timestamp:
01/27/2011 06:37:49 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Prevent bp-loader.php from throwing notices if it is included more than once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r3917 r3946  
    1111/** Constants *****************************************************************/
    1212
    13 define( 'BP_VERSION', '1.3-bleeding' );
    14 define( 'BP_DB_VERSION', 3605 );
     13// Define the BuddyPress version
     14if ( !defined( 'BP_VERSION' ) )
     15    define( 'BP_VERSION', '1.3-bleeding' );
     16
     17// Define the database version
     18if ( !defined( 'BP_DB_VERSION' ) )
     19    define( 'BP_DB_VERSION', 3605 );
    1520
    1621// Define on which blog ID BuddyPress should run
     
    1924
    2025// Path and URL
    21 define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
    22 define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
     26if ( !defined( 'BP_PLUGIN_DIR' ) )
     27    define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
     28
     29if ( !defined( 'BP_PLUGIN_URL' ) )
     30    define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
    2331
    2432// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
    25 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
     33require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
    2634
    2735// Place your custom code (actions/filters) in a file called
    2836// '/plugins/bp-custom.php' and it will be loaded before anything else.
    2937if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
    30     require( WP_PLUGIN_DIR . '/bp-custom.php' );
     38    require_once( WP_PLUGIN_DIR . '/bp-custom.php' );
    3139
    3240// Define the user and usermeta table names, useful if you are using custom or shared tables.
     
    4553require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-bootstrap.php' );
    4654
    47 /**
     55if ( !function_exists( 'bp_loader_activate' ) ) :
     56/**
    4857 * Defines BP's activation routine.
    4958 *
     
    6978}
    7079register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
     80endif;
    7181
     82if ( !function_exists( 'bp_loader_deactivate' ) ) :
    7283// Deactivation Function
    7384function bp_loader_deactivate() {
     
    7586}
    7687register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
     88endif;
    7789
    7890?>
Note: See TracChangeset for help on using the changeset viewer.