review-meta.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * The template to display the reviewers meta data (name, verified owner, review date)
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/single-product/review-meta.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. * @package WooCommerce/Templates
  15. * @version 3.4.0
  16. */
  17. defined( 'ABSPATH' ) || exit;
  18. global $comment;
  19. $verified = wc_review_is_from_verified_owner( $comment->comment_ID );
  20. if ( '0' === $comment->comment_approved ) { ?>
  21. <p class="meta">
  22. <em class="woocommerce-review__awaiting-approval">
  23. <?php esc_html_e( 'Your review is awaiting approval', 'woocommerce' ); ?>
  24. </em>
  25. </p>
  26. <?php } else { ?>
  27. <p class="meta">
  28. <strong class="woocommerce-review__author"><?php comment_author(); ?> </strong>
  29. <?php
  30. if ( 'yes' === get_option( 'woocommerce_review_rating_verification_label' ) && $verified ) {
  31. echo '<em class="woocommerce-review__verified verified">(' . esc_attr__( 'verified owner', 'woocommerce' ) . ')</em> ';
  32. }
  33. ?>
  34. <span class="woocommerce-review__dash">&ndash;</span> <time class="woocommerce-review__published-date" datetime="<?php echo esc_attr( get_comment_date( 'c' ) ); ?>"><?php echo esc_html( get_comment_date( wc_date_format() ) ); ?></time>
  35. </p>
  36. <?php
  37. }