short-description check

Apply woocommerce_short_description filter before check if excerpt is empty;

Per new Woo template files;
This commit is contained in:
Unknown 2018-03-22 14:41:54 -06:00 committed by zachary
parent da3cdfa847
commit 0ee0b8a44f
1 changed files with 5 additions and 3 deletions

View File

@ -22,11 +22,13 @@ if ( ! defined( 'ABSPATH' ) ) {
global $post;
if ( ! $post->post_excerpt ) {
$short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );
if ( ! $short_description ) {
return;
}
?>
<div itemprop="description" class="lead">
<?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>
<div class="woocommerce-product-details__short-description">
<?php echo $short_description; // WPCS: XSS ok. ?>
</div>