BuddyPress::instance()

Main BuddyPress Instance.


Description Description

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.

See also See also


Top ↑

Return Return

(BuddyPress|null) The one true BuddyPress.


Top ↑

Source Source

File: class-buddypress.php

	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 BuddyPress;
			$instance->constants();
			$instance->setup_globals();
			$instance->legacy_constants();
			$instance->includes();
			$instance->setup_actions();
		}

		// Always return the instance
		return $instance;

		// The last metroid is in captivity. The galaxy is at peace.
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.