Merge pull request #17981 from ibndawood/master

Made common template functions pluggable
This commit is contained in:
Claudio Sanches 2017-12-01 14:12:11 -02:00 committed by GitHub
commit f2d2077c30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 23 deletions

View File

@ -653,33 +653,45 @@ if ( ! function_exists( 'woocommerce_template_loop_category_title' ) ) {
<?php
}
}
/**
* Insert the opening anchor tag for products in the loop.
*/
function woocommerce_template_loop_product_link_open() {
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
}
/**
* Insert the opening anchor tag for products in the loop.
*/
function woocommerce_template_loop_product_link_close() {
echo '</a>';
if ( ! function_exists( 'woocommerce_template_loop_product_link_open' ) ) {
/**
* Insert the opening anchor tag for products in the loop.
*/
function woocommerce_template_loop_product_link_open() {
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
}
}
/**
* Insert the opening anchor tag for categories in the loop.
*
* @param int|object|string $category Category ID, Object or String.
*/
function woocommerce_template_loop_category_link_open( $category ) {
echo '<a href="' . esc_url( get_term_link( $category, 'product_cat' ) ) . '">';
if ( ! function_exists( 'woocommerce_template_loop_product_link_close' ) ) {
/**
* Insert the opening anchor tag for products in the loop.
*/
function woocommerce_template_loop_product_link_close() {
echo '</a>';
}
}
/**
* Insert the closing anchor tag for categories in the loop.
*/
function woocommerce_template_loop_category_link_close() {
echo '</a>';
if ( ! function_exists( 'woocommerce_template_loop_category_link_open' ) ) {
/**
* Insert the opening anchor tag for categories in the loop.
*
* @param int|object|string $category Category ID, Object or String.
*/
function woocommerce_template_loop_category_link_open( $category ) {
echo '<a href="' . esc_url( get_term_link( $category, 'product_cat' ) ) . '">';
}
}
if ( ! function_exists( 'woocommerce_template_loop_category_link_close' ) ) {
/**
* Insert the closing anchor tag for categories in the loop.
*/
function woocommerce_template_loop_category_link_close() {
echo '</a>';
}
}
if ( ! function_exists( 'woocommerce_taxonomy_archive_description' ) ) {
/**