BP_Group_Extension::_register()

The main setup routine for the extension.


Description 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 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();
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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