short-description.php 1022 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Single product short description
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/single-product/short-description.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @author Automattic
  15. * @package WooCommerce/Templates
  16. * @version 3.3.0
  17. */
  18. if ( ! defined( 'ABSPATH' ) ) {
  19. exit; // Exit if accessed directly.
  20. }
  21. global $post;
  22. $short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );
  23. if ( ! $short_description ) {
  24. return;
  25. }
  26. ?>
  27. <div class="woocommerce-product-details__short-description">
  28. <?php echo $short_description; // WPCS: XSS ok. ?>
  29. </div>