Your logic looks to me like it boils down to “if union
is selected, then echo a link to union
, else do nothing.” I think your description is much too complicated. It looks like you can effectively ignore paid
completely.
function wpv_check_for_union_func($attr,$content="") {
global $post;
$taxonomy = 'yourtaxslug';
$union = has_term('union', $taxonomy, $post);
if ($union) {
$term_link = get_term_link( 'union', $taxonomy );
if( !is_wp_error( $term_link ) ) {
return '<a href="' . $term_link . '">union</a>';
}
}
}
add_shortcode( 'wpv_check_for_union', 'wpv_check_for_union_func' );