Advertisement
uabassguy

wp_error

Sep 9th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. $termchildren = get_term_children( $taxID, $taxType );
  2.  
  3. echo '<ul>';
  4. foreach ( $termchildren as $child ) {
  5. $term = get_term_by( 'id', $child, $taxType );
  6.  
  7. $term_link = get_term_link( $term->name, $taxType );
  8.  
  9. if( ! is_wp_error( $term_link ) )
  10. echo '<li><a href="' . $term_link . '">' . $term->name . '</a></li>';
  11.  
  12. if( is_wp_error( $term_link ) )
  13. echo $term_link->get_error_message();echo " taxType: ".$taxType." taxID: ".$taxID;
  14.  
  15. }
  16. echo '</ul>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement