Advertisement
sparkweb

Category Children Write Filter

Apr 6th, 2012
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. add_filter('foxyshop_category_children_write', 'my_foxyshop_category_children_write', 10, 2);
  2. function my_foxyshop_category_children_write($liwrite, $term) {
  3.     global $taxonomy_images_plugin, $post;
  4.    
  5.     if (substr($term->name,0,1) == "_") continue;
  6.  
  7.     $url = get_term_link($term, "foxyshop_categories");
  8.     $liwrite = "";
  9.     $liwrite .= '<li id="foxyshop_category_' . $term->term_id . '">';
  10.     $liwrite .= '<h2><a href="' . $url . '">' . $term->name . '</a></h2>';
  11.     if ($term->description) $liwrite .= apply_filters('the_content', $term->description);
  12.     if (isset($taxonomy_images_plugin)) {
  13.         $img = $taxonomy_images_plugin->get_image_html("thumbnail", $term->term_taxonomy_id);
  14.         if(!empty($img)) $liwrite .= '<a href="' . $url . '" class="foxyshop_category_image">' . $img . '</a>';
  15.     }
  16.     $liwrite .= '</li>'."\n";
  17.    
  18.     return $liwrite;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement