/** * Main bbPress Instance * * bbPress is fun * Please load it only one time * For this, we thank you * * Insures that only one instance of bbPress exists in memory at any one * time. Also prevents needing to define globals all over the place. * * @since bbPress (r3757) * @staticvar object $instance * @uses bbPress::setup_globals() Setup the globals needed * @uses bbPress::includes() Include the required files * @uses bbPress::setup_actions() Setup the hooks and actions * @see bbpress() * @return The one true bbPress */ public static function instance() { // Store the instance locally to avoid private static replication static $instance = null; // Only run these methods if they haven't been ran previously if (null === $instance) { $instance = new bbPress(); $instance->setup_globals(); $instance->includes(); $instance->setup_actions(); } // Always return the instance return $instance; }