LLMS_Site::get_feature( string $feature )
Get a single feature’s status
Description Description
Checks for a feature constant first and, if none is defined, uses the stored site setting (with a fallback to the default value), and a final fallback to false if the feature cannot be found.
Parameters Parameters
- $feature
-
(string) (Required) Feature id/key.
Return Return
(bool)
Source Source
File: includes/class.llms.site.php
public static function get_feature( $feature ) {
$status = self::get_feature_constant( $feature );
if ( is_null( $status ) ) {
$features = self::get_features();
$status = isset( $features[ $feature ] ) ? $features[ $feature ] : false;
}
/**
* Filters the status of a LLMS_Site feature.
*
* @since 4.12.0
*
* @param boolean $status Status of the feature.
* @param string $feature The feature ID/key.
*/
return apply_filters( 'llms_site_get_feature', $status, $feature );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.12.0 | Allow feature configuration via constants. |
| 3.0.0 | Introduced. |