Allow related title changes

This modification enables the change of the related products title via a filter
This commit is contained in:
Andrej Mernik 2019-11-18 07:58:46 +01:00 committed by GitHub
parent 05a89e849e
commit 36f2b7d744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -22,9 +22,12 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( $related_products ) : ?> if ( $related_products ) : ?>
<section class="related products"> <section class="related products">
<?php
<h2><?php esc_html_e( 'Related products', 'woocommerce' ); ?></h2> $heading = apply_filters( 'woocommerce_product_related_heading', __( 'Related products', 'woocommerce' ) );
if ( $heading ) : ?>
<h2><?php echo esc_html( $heading ); ?></h2>
<?php endif; ?>
<?php woocommerce_product_loop_start(); ?> <?php woocommerce_product_loop_start(); ?>
<?php foreach ( $related_products as $related_product ) : ?> <?php foreach ( $related_products as $related_product ) : ?>