Feature_Manager
Feature Manager class.
Reads the raw settings option to determine whether an optional feature should be instantiated. All features default to enabled - a missing settings key means the feature is on, so upgrades see no change in behaviour.
This class intentionally does not use tptn_get_option(): that function falls back to the registered settings defaults, which would load the admin Settings class on every request. It is safe to call at plugins_loaded.
Namespace: WebberZone\Top_Ten
Since: 4.4.0
Source: includes/class-feature-manager.php line 31
Methods
get_features() static
Get the map of toggleable features.
Since: 4.4.0
Line: 49
static public function get_features( ): array;
Returns: array — Associative array of feature ID => array with ‘setting’ and ‘default’ keys.
is_enabled() static
Whether a feature is enabled.
A feature is enabled when its setting is missing (default) or truthy. Unknown feature IDs are treated as enabled.
Since: 4.4.0
Line: 110
static public function is_enabled( string $feature ): bool;
| Type | Name | Description |
|---|---|---|
string | $feature | Feature ID. |
Returns: bool — Whether the feature is enabled.