handle bundle product prices editor and prices summary
This commit is contained in:
@@ -6,17 +6,19 @@ class Wiaas_Product {
|
||||
require_once dirname( __FILE__ ) . '/product/class-wiaas-product-category.php';
|
||||
require_once dirname( __FILE__ ) . '/product/class-wiaas-product-supplier.php';
|
||||
|
||||
add_filter('woocommerce_register_post_type_product', array(__CLASS__, 'define_product_capabilities'));
|
||||
add_filter('woocommerce_register_post_type_product', array(__CLASS__, 'manage_product_settings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define capabilities for editing products so we can easily control read/edit/create access for them
|
||||
* Update product type settins before it is created:
|
||||
* - Define capabilities for editing products so we can easily control read/edit/create access for them
|
||||
* - Declare fields supported by product
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function define_product_capabilities($args) {
|
||||
public static function manage_product_settings($args) {
|
||||
|
||||
$args['capabilities'] = array(
|
||||
'edit_post' => 'edit_product',
|
||||
@@ -28,6 +30,10 @@ class Wiaas_Product {
|
||||
'read_private_posts' => 'read_private_products',
|
||||
'create_posts' => 'create_products', // use `create_products` instead of default `edit_products`
|
||||
);
|
||||
|
||||
$args['supports'] = array( 'title', 'thumbnail' );
|
||||
|
||||
|
||||
return $args;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user