Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 08:39:23 PM (13 years ago)
Author:
johnjamesjacoby
Message:

bp-loader.php is a real boy! Introduce BuddyPress class to handle the loading of BuddyPress core and provide declarations to the $bp global variables. Ports several functions and methods from bbPress 2.0 into bp-core-update.php to manage the hand-off into the update routine. See #3739.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-functions.php

    r5305 r5309  
    11<?php
     2
     3/**
     4 * BuddyPress Common Functions
     5 *
     6 * @package BuddyPress
     7 * @subpackage Functions
     8 */
     9
    210// Exit if accessed directly
    311if ( !defined( 'ABSPATH' ) ) exit;
     12
     13/** Versions ******************************************************************/
     14
     15/**
     16 * Output the BuddyPress version
     17 *
     18 * @since BuddyPress (1.6)
     19 * @uses bp_get_version() To get the BuddyPress version
     20 */
     21function bp_version() {
     22    echo bp_get_version();
     23}
     24    /**
     25     * Return the BuddyPress version
     26     *
     27     * @since BuddyPress (1.6)
     28     * @global BuddyPress $bp
     29     * @retrun string The BuddyPress version
     30     */
     31    function bp_get_version() {
     32        global $bp;
     33        return $bp->version;
     34    }
     35
     36/**
     37 * Output the BuddyPress database version
     38 *
     39 * @since BuddyPress (1.6)
     40 * @uses bp_get_version() To get the BuddyPress version
     41 */
     42function bp_db_version() {
     43    echo bp_get_db_version();
     44}
     45    /**
     46     * Return the BuddyPress database version
     47     *
     48     * @since BuddyPress (1.6)
     49     * @global BuddyPress $bp
     50     * @retrun string The BuddyPress version
     51     */
     52    function bp_get_db_version() {
     53        global $bp;
     54        return $bp->db_version;
     55    }
     56
     57/** Functions *****************************************************************/
    458
    559/**
     
    11201174 */
    11211175function bp_is_root_blog( $blog_id = 0 ) {
     1176
    11221177    // Assume false
    11231178    $is_root_blog = false;
     
    11401195 * @since 1.5
    11411196 *
    1142  * @param int $blog_id Optional. Defaults to the current blog id.
    11431197 * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id().
    11441198 */
    1145 function bp_get_root_blog_id( $blog_id = false ) {
     1199function bp_get_root_blog_id() {
     1200
     1201    // Default to 1
     1202    $root_blog_id = 1;
    11461203
    11471204    // Define on which blog ID BuddyPress should run
     
    11561213        } elseif ( is_multisite() && bp_is_multiblog_mode() ) {
    11571214            $root_blog_id = get_current_blog_id();
    1158 
    1159         // Root blog is the only blog on this network
    1160         } elseif( !is_multisite() ) {
    1161             $root_blog_id = 1;
    11621215        }
    11631216
Note: See TracChangeset for help on using the changeset viewer.