Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ql_get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '', $exclude = array() ) {
- //$terms = get_the_terms( $id, $taxonomy );
- $exclude_string = implode ( ',', $exclude );
- $terms = get_terms( $taxonomy, array(
- 'exclude' => $exclude_string,
- ) );
- if ( is_wp_error( $terms ) )
- return $terms;
- if ( empty( $terms ) )
- return false;
- foreach ( $terms as $term ) {
- //if( !in_array($term->term_id, $exclude )) { // add term to array if not excluded explicitly by ID ##
- $link = get_term_link( $term, $taxonomy );
- if ( is_wp_error( $link ) )
- return $link;
- $term_links[] = '<a href="' . $link . '" rel="tag">' . $term->name . '</a>';
- //}
- }
- $term_links = apply_filters( "term_links-$taxonomy", $term_links );
- return $before . join( $sep, $term_links ) . $after;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement