Skip to content

Instantly share code, notes, and snippets.

@alexminza
Created February 5, 2018 18:36
Show Gist options
  • Save alexminza/e53b6cc5aa42a55c55b25fbc6658cd51 to your computer and use it in GitHub Desktop.
Save alexminza/e53b6cc5aa42a55c55b25fbc6658cd51 to your computer and use it in GitHub Desktop.
WooCommerce attribute_url shortcode - Shortcodes, Actions and Filters plugin
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