/**
  * Check if plugin dependencies are satisfied and add an admin notice if not
  *
  * @return bool
  */
 public static function is_dependency_satisfied()
 {
     if (class_exists('BuddyPress') && version_compare(BuddyPress::instance()->version, self::PLUGIN_MIN_VERSION, '>=')) {
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * The main function responsible for returning the one true BuddyPress Instance to functions everywhere.
  *
  * Use this function like you would a global variable, except without needing
  * to declare the global.
  *
  * Example: <?php $bp = buddypress(); ?>
  *
  * @return BuddyPress The one true BuddyPress Instance.
  */
 function buddypress()
 {
     return BuddyPress::instance();
 }
Exemplo n.º 3
0
 /**
  * Main BuddyPress Instance
  *
  * BuddyPress is great
  * Please load it only one time
  * For this, we thank you
  *
  * Insures that only one instance of BuddyPress exists in memory at any one
  * time. Also prevents needing to define globals all over the place.
  *
  * @since BuddyPress (1.7)
  *
  * @staticvar array $instance
  * @uses BuddyPress::constants() Setup the constants (mostly deprecated)
  * @uses BuddyPress::setup_globals() Setup the globals needed
  * @uses BuddyPress::includes() Include the required files
  * @uses BuddyPress::setup_actions() Setup the hooks and actions
  * @see buddypress()
  *
  * @return BuddyPress The one true BuddyPress
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new BuddyPress();
         self::$instance->constants();
         self::$instance->setup_globals();
         self::$instance->legacy_constants();
         self::$instance->includes();
         self::$instance->setup_actions();
     }
     return self::$instance;
 }