BP_Group_Extension::_register()

The main setup routine for the extension.

Description

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().

Source

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

	public function _register() {

		// Detect and parse properties set by legacy extensions.
		$this->parse_legacy_properties();

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

		// 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.
		$this->setup_screens();

		// Configure access-related settings.
		$this->setup_access_settings();

		// Mirror configuration data so it's accessible to plugins
		// that look for it in its old locations.
		$this->setup_legacy_properties();

		// Hook the extension into BuddyPress.
		$this->setup_display_hooks();
		$this->setup_create_hooks();
		$this->setup_edit_hooks();
		$this->setup_admin_hooks();
	}

Changelog

Changelog
Version Description
BuddyPress 1.1.0 Introduced.

Questions?

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.