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.


Top ↑

Parameters Parameters

$feature

(string) (Required) Feature id/key.


Top ↑

Return Return

(bool)


Top ↑

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 );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.12.0 Allow feature configuration via constants.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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