WC_Product_Factory::get_classname_from_product_type( string $product_type )

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

Description Description

Parameters Parameters


(string) (Required) Product type.

Top ↑

Return Return


Top ↑

Source Source

File: includes/class-wc-product-factory.php

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

Top ↑

User Contributed Notes User Contributed Notes

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