Changeset 7346
- Timestamp:
- 08/12/2013 09:56:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-loader.php
r7288 r7346 107 107 108 108 /** 109 * @var BuddyPress The one true BuddyPress110 */111 private static $instance;112 113 /**114 109 * Main BuddyPress Instance 115 110 * … … 123 118 * @since BuddyPress (1.7) 124 119 * 125 * @staticvar array$instance120 * @staticvar object $instance 126 121 * @uses BuddyPress::constants() Setup the constants (mostly deprecated) 127 122 * @uses BuddyPress::setup_globals() Setup the globals needed 123 * @uses BuddyPress::legacy_constants() Setup the legacy constants (deprecated) 128 124 * @uses BuddyPress::includes() Include the required files 129 125 * @uses BuddyPress::setup_actions() Setup the hooks and actions … … 133 129 */ 134 130 public static function instance() { 135 if ( ! isset( self::$instance ) ) { 136 self::$instance = new BuddyPress; 137 self::$instance->constants(); 138 self::$instance->setup_globals(); 139 self::$instance->legacy_constants(); 140 self::$instance->includes(); 141 self::$instance->setup_actions(); 131 132 // Store the instance locally to avoid private static replication 133 static $instance = null; 134 135 // Only run these methods if they haven't been ran previously 136 if ( null === $instance ) { 137 $instance = new BuddyPress; 138 $instance->constants(); 139 $instance->setup_globals(); 140 $instance->legacy_constants(); 141 $instance->includes(); 142 $instance->setup_actions(); 142 143 } 143 return self::$instance; 144 145 // Always return the instance 146 return $instance; 144 147 } 145 148
Note: See TracChangeset
for help on using the changeset viewer.