Advertisement
Guest User

Functions Code

a guest
May 4th, 2012
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. // dropdown filter
  2. class dropdown extends Walker_CategoryDropdown {
  3.  
  4.     function start_el(&$output, $category, $depth, $args) {
  5.         $pad = str_repeat(' ', $depth * 3);
  6.  
  7.         $cat_name = apply_filters('list_cats', $category->name, $category);
  8.         $output .= "\t<option class=\"level-$depth\" value=\"".$category->slug."\"";
  9.         if ( $category->term_id == $args['selected'] )
  10.             $output .= ' selected="selected"';
  11.         $output .= '>';
  12.         $output .= $pad.$cat_name;
  13.         if ( $args['show_count'] )
  14.             $output .= '&nbsp;&nbsp;('. $category->count .')';
  15.         if ( $args['show_last_update'] ) {
  16.             $format = 'Y-m-d';
  17.             $output .= '&nbsp;&nbsp;' . gmdate($format, $category->last_update_timestamp);
  18.         }
  19.         $output .= "</option>\n";
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement