Exemplo n.º 1
0
/**
 * Shows product related categories
 *
 * @param type $atts
 * @return string
 */
function ic_product_related_categories($atts)
{
    $args = shortcode_atts(array('product' => get_the_ID()), $atts);
    return get_related_categories($args['product']);
}
Exemplo n.º 2
0
/**
 * Shows related categories table on product page
 *
 * @param object $post
 * @param array $single_names
 * @param string $taxonomy_name
 * @return string
 */
function show_related_categories($post, $single_names, $taxonomy_name)
{
    $settings = get_multiple_settings();
    if ($settings['related'] == 'categories') {
        echo get_related_categories($post->ID, $single_names, $taxonomy_name);
    } else {
        echo get_related_products(null, true);
    }
}