Advertisement
Guest User

Destroying last array element using unset

a guest
Apr 10th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. <?php
  2. $terms = apply_filters( 'taxonomy-images-get-terms', '' , array(
  3. 'taxonomy' => 'tutors',
  4. ) );
  5. if ( !empty( $terms ) ) {
  6. print '<ul>';
  7. foreach( (array) $terms as $term ) {
  8. print '<li><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'thumbnail' ) . '</li>';
  9. }
  10. unset($term);
  11.  
  12. print '</ul>';
  13. }
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement