Introduced wc_get_product_classname function

This commit is contained in:
Claudio Sanches 2019-11-13 14:57:54 -03:00
parent 0f28a61910
commit 24560f93bf
1 changed files with 15 additions and 0 deletions

View File

@ -64,6 +64,21 @@ function wc_get_product( $the_product = false, $deprecated = array() ) {
return WC()->product_factory->get_product( $the_product, $deprecated );
}
/**
* Get product class name.
*
* @see WC_Product_Factory::get_product_classname
* @since 3.9.0
* @param string $product_type Product type.
* @param int $product_id Product ID.
* @return WC_Product
*/
function wc_get_product_classname( $product_type, $product_id = 0 ) {
$classname = WC_Product_Factory::get_product_classname( $product_id, $product_type );
return new $classname();
}
/**
* Returns whether or not SKUS are enabled.
*