made function : woocommerce_template_loop_product_link_open, woocommerce_template_loop_product_link_close, woocommerce_template_loop_category_link_open, woocommerce_template_loop_category_link_close pluggable

This commit is contained in:
Ibrahim Ibn Dawood 2017-12-01 14:58:42 +05:30
parent bbc472d80d
commit b1bef237d1
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' ) ) {
/**