예제 #1
0
 /**
  * Main BuddyPress Global Search Instance.
  *
  * Insures that only one instance of BuddyPress Global Search exists in memory at any
  * one time. Also prevents needing to define globals all over the place.
  *
  * @since 1.0.0
  *
  * @static object $instance
  * @uses BuddyBoss_Global_Search_Plugin::setup_globals() Setup the globals needed.
  * @uses BuddyBoss_Global_Search_Plugin::setup_actions() Setup the hooks and actions.
  * @uses BuddyBoss_Global_Search_Plugin::setup_textdomain() Setup the plugin's language file.
  * @see buddyboss_global_search()
  *
  * @return object BuddyBoss_Global_Search_Plugin
  */
 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 run previously
     if (null === $instance) {
         $instance = new BuddyBoss_Global_Search_Plugin();
         $instance->setup_globals();
         $instance->setup_actions();
         $instance->setup_textdomain();
     }
     // Always return the instance
     return $instance;
 }