Automattic\WooCommerce\Admin\Features

Features::get_feature_class()public staticWC 1.0

Get the feature class as a string.

Method of the class: Features{}

No Hooks.

Return

String|null.

Usage

$result = Features::get_feature_class( $feature );
$feature(string) (required)
Feature name.

Features::get_feature_class() code WC 7.1.0

public static function get_feature_class( $feature ) {
	$feature       = str_replace( '-', '', ucwords( strtolower( $feature ), '-' ) );
	$feature_class = 'Automattic\\WooCommerce\\Admin\\Features\\' . $feature;

	if ( class_exists( $feature_class ) ) {
		return $feature_class;
	}

	// Handle features contained in subdirectory.
	if ( class_exists( $feature_class . '\\Init' ) ) {
		return $feature_class . '\\Init';
	}

	return null;
}