Removing woocommerce short description field

2019-02-15 18:36发布

I'm creating a theme designed specifically for usage with woocommerce. This theme's design does not utilize the "Product Short Description". Removing that description from displaying on the page was easy enough using:

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20);

However, I cannot seem to find any way to remove the field/panel itself from showing to the admin on the product editing pages. If anyone knows how to do that, it would be greatly appreciated. To be clear this is the newer woocommerce 2.0. Thanks!

3条回答
手持菜刀,她持情操
2楼-- · 2019-02-15 19:16

You can remove the Short Description field from the WooCommerce admin area via PHP:

function remove_short_description() {
     remove_meta_box( 'postexcerpt', 'product', 'normal');
}

add_action('add_meta_boxes', 'remove_short_description', 999);
查看更多
ら.Afraid
3楼-- · 2019-02-15 19:20

As answered in different treads:

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );

function woocommerce_template_single_excerpt() {
    return;
}
查看更多
ら.Afraid
4楼-- · 2019-02-15 19:27

This is also what I am looking for. For me, to target the product description's css, use .single-product .entry-content.

Until now, I think Woocommerce doesn't provide any hook for product description only.

查看更多
登录 后发表回答