Created
February 5, 2018 18:36
-
-
Save alexminza/e53b6cc5aa42a55c55b25fbc6658cd51 to your computer and use it in GitHub Desktop.
WooCommerce attribute_url shortcode - Shortcodes, Actions and Filters plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(empty($atts)) { | |
return ''; | |
} | |
$slug = $atts['slug']; | |
$taxonomy = $atts['taxonomy']; | |
$term_link = get_term_link($slug, $taxonomy); | |
if(is_wp_error($term_link)) { | |
return $term_link->get_error_message(); | |
} | |
return esc_url($term_link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment