The main setup routine for the extension.


This method contains the primary logic for setting up an extension’s configuration, setting up backward compatibility for legacy plugins, and hooking the extension’s screen functions into WP and BP.

Marked ‘public’ because it must be accessible to add_action(). However, you should never need to invoke this method yourself – it is called automatically at the right point in the load order by bp_register_group_extension().


File: bp-groups/classes/class-bp-group-extension.php

	public function _register() {

		// Detect and parse properties set by legacy extensions.

		// Initialize, if necessary. This should only happen for
		// legacy extensions that don't call parent::init() themselves.
		if ( true !== $this->initialized ) {

		// Set some config values, based on the parsed params.
		$this->group_id          = $this->get_group_id();
		$this->slug              = $this->params['slug'];
		$this->name              = $this->params['name'];
		$this->visibility        = $this->params['visibility'];
		$this->nav_item_position = $this->params['nav_item_position'];
		$this->nav_item_name     = $this->params['nav_item_name'];
		$this->display_hook      = $this->params['display_hook'];
		$this->template_file     = $this->params['template_file'];

		// Configure 'screens': create, admin, and edit contexts.

		// Configure access-related settings.

		// Mirror configuration data so it's accessible to plugins
		// that look for it in its old locations.

		// Hook the extension into BuddyPress.


Version Description
BuddyPress 1.1.0 Introduced.


We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.