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

Is the specified screen enabled?

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

$context

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

Default value: ''

Return

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

Source

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

1288
1289
1290
1291
1292
1293
1294
1295
1296
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;
}

Changelog

Changelog
Version Description
BuddyPress 1.8.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.