WC_Product_Factory::get_classname_from_product_type()public staticWC 1.0

Create a WC coding standards compliant class name e.g. WC_Product_Type_Class instead of WC_Product_type-class.

Method of the class: WC_Product_Factory{}

No Hooks.

Return

String|false.

Usage

$result = WC_Product_Factory::get_classname_from_product_type( $product_type );
$product_type(string) (required)
Product type.

WC_Product_Factory::get_classname_from_product_type() code WC 9.4.2

public static function get_classname_from_product_type( $product_type ) {
	return $product_type ? 'WC_Product_' . implode( '_', array_map( 'ucfirst', explode( '-', $product_type ) ) ) : false;
}