Deleted error logs

This commit is contained in:
Nedim Uka
2018-09-20 12:34:54 +02:00
parent 246656bc56
commit d3b0d10143
5 changed files with 2 additions and 7 deletions

View File

@@ -0,0 +1,46 @@
<?php
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
if (false === $template_term_exists = get_term_by('slug', 'wiaastemplate', 'product_type')) {
wp_insert_term('wiaastemplate', 'product_type');
}
function construct_template_products_class() {
class WC_Product_Template extends WC_Product {
public function __construct($product) {
parent::__construct($product);
}
/**
* Get internal type.
*
* @return string
*/
public function get_type() {
return 'wiaastemplate';
}
}
}
add_action('init', 'construct_template_products_class');
function woocommerce_product_class($classname, $product_type) {
if ($product_type == 'wiaastemplate') {
$classname = 'WC_Product_Template';
}
return $classname;
}
add_filter('woocommerce_product_class', 'woocommerce_product_class', 10, 2);