Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/25/2012 08:50:27 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Turn bbPress into a singleton.

  • Introduce bbpress() function to get the bbPress instance
  • Replace all $bbp global references with calls to bbpress()
  • Update bbPress class with matching singleton private static $instance variable and public static method
  • Fixes #1759.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-users.php

    r3627 r3758  
    109109 */
    110110function bbp_users_admin() {
    111     global $bbp;
    112 
    113     // Bail if bbPress is not loaded
    114     if ( !is_a( $bbp, 'bbPress' ) ) return;
    115 
    116     $bbp->admin->users = new BBP_Users_Admin();
     111    bbpress()->admin->users = new BBP_Users_Admin();
    117112}
    118113
Note: See TracChangeset for help on using the changeset viewer.