diff --git a/includes/Features.php b/includes/Features.php index 8b41598..a2bf61b 100644 --- a/includes/Features.php +++ b/includes/Features.php @@ -118,6 +118,7 @@ public static function assets() { 'NewfoldFeatures', array( 'features' => self::getFeatures(), + 'togglable' => self::getToggleableFeatures(), 'restUrl' => esc_url_raw( rest_url() ) . 'newfold-features/v1', ) ); @@ -160,6 +161,19 @@ public static function getFeatures() { return $features; } + /** + * Get All Features and filter states + * + * @return Array list of features and enabled states (key:name value:enabled) + */ + public static function getToggleableFeatures() { + $features = array(); + foreach ( self::getFeatureList() as $feature ) { + $features[ $feature ] = Features::getInstance()->getFeature( $feature )->isTogglable(); + } + return $features; + } + /** * Get feature list *