BP_Group_Extension::is_screen_enabled( string $context = '' )

Is the specified screen enabled?


Description Description

To be enabled, a screen must both have the ‘enabled’ key set to true (legacy: $this->enable_create_step, etc), and its screen_callback must also exist and be callable.


Parameters Parameters

$context

(Optional) Screen context. 'create', 'edit', or 'admin'.

Default value: ''


Top ↑

Return Return

(bool) True if the screen is enabled, otherwise false.


Top ↑

Source Source

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

	public function is_screen_enabled( $context = '' ) {
		$enabled = false;

		if ( isset( $this->screens[ $context ] ) ) {
			$enabled = $this->screens[ $context ]['enabled'] && is_callable( $this->screens[ $context ]['screen_callback'] );
		}

		return (bool) $enabled;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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