Merge pull request #18231 from woocommerce/fix/18225
Apply woocommerce_short_description filter before check if excerpt is empty
This commit is contained in:
commit
2c6a39716f
|
@ -10,23 +10,25 @@
|
||||||
* happen. When this occurs the version of the template file will be bumped and
|
* happen. When this occurs the version of the template file will be bumped and
|
||||||
* the readme will list any important changes.
|
* the readme will list any important changes.
|
||||||
*
|
*
|
||||||
* @see https://docs.woocommerce.com/document/template-structure/
|
* @see https://docs.woocommerce.com/document/template-structure/
|
||||||
* @author WooThemes
|
* @author Automattic
|
||||||
* @package WooCommerce/Templates
|
* @package WooCommerce/Templates
|
||||||
* @version 1.6.4
|
* @version 3.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
exit; // Exit if accessed directly
|
exit; // Exit if accessed directly.
|
||||||
}
|
}
|
||||||
|
|
||||||
global $post;
|
global $post;
|
||||||
|
|
||||||
if ( ! $post->post_excerpt ) {
|
$short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );
|
||||||
|
|
||||||
|
if ( ! $short_description ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="woocommerce-product-details__short-description">
|
<div class="woocommerce-product-details__short-description">
|
||||||
<?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ); ?>
|
<?php echo $short_description; // WPCS: XSS ok. ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue