コード例 #1
0
ファイル: bbpress.php プロジェクト: CompositeUK/clone.bbPress
 /**
  * The main function responsible for returning the one true bbPress Instance
  * to functions everywhere.
  *
  * Use this function like you would a global variable, except without needing
  * to declare the global.
  *
  * Example: <?php $bbp = bbpress(); ?>
  *
  * @return bbPress The one true bbPress Instance
  */
 function bbpress()
 {
     return bbPress::instance();
 }
コード例 #2
0
ファイル: bbpress.php プロジェクト: hscale/webento
 /**
  * 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 array $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()
 {
     if (!isset(self::$instance)) {
         self::$instance = new bbPress();
         self::$instance->setup_globals();
         self::$instance->includes();
         self::$instance->setup_actions();
     }
     return self::$instance;
 }