Skip to:
Content

BuddyPress.org

Changeset 6590


Ignore:
Timestamp:
12/10/2012 10:08:48 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Introduce legacy_constants() method, to handle the setting of old BuddyPress constants that some plugins might still look for. Props ddean. Fixes #4550.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r6561 r6590  
    136136            self::$instance->constants();
    137137            self::$instance->setup_globals();
     138            self::$instance->legacy_constants();
    138139            self::$instance->includes();
    139140            self::$instance->setup_actions();
     
    191192
    192193    /**
    193      * Legacy BuddyPress constants
    194      *
    195      * Try to avoid using these. Their values have been moved into variables
    196      * in the $bp global, and have matching functions to get/set their value.
    197      *
     194     * Bootstrap constants
     195     *
    198196     * @since BuddyPress (1.6)
    199197     *
     
    205203     */
    206204    private function constants() {
    207 
    208         // Define the BuddyPress version
    209         if ( !defined( 'BP_VERSION' ) )
    210             define( 'BP_VERSION', $this->version );
    211 
    212         // Define the database version
    213         if ( !defined( 'BP_DB_VERSION' ) )
    214             define( 'BP_DB_VERSION', $this->db_version );
    215205
    216206        // Place your custom code (actions/filters) in a file called
     
    356346        $this->current_user   = new stdClass();
    357347        $this->displayed_user = new stdClass();
     348    }
     349
     350    /**
     351     * Legacy BuddyPress constants
     352     *
     353     * Try to avoid using these. Their values have been moved into variables
     354     * in the instance, and have matching functions to get/set their values.
     355     *
     356     * @since BuddyPress (1.7)
     357     */
     358    private function legacy_constants() {
     359
     360        // Define the BuddyPress version
     361        if ( !defined( 'BP_VERSION'    ) ) define( 'BP_VERSION',    $this->version   );
     362
     363        // Define the database version
     364        if ( !defined( 'BP_DB_VERSION' ) ) define( 'BP_DB_VERSION', $this->db_version );
    358365    }
    359366
Note: See TracChangeset for help on using the changeset viewer.