WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 578 | extract($args); |
| 579 | |
| 580 | $cat_name = attribute_escape( $category->cat_name); |
| 581 | $link = '<a href="' . get_category_link( $category->cat_ID ) . '" '; |
| 582 | if ( $use_desc_for_title == 0 || empty($category->category_description) ) |
| 583 | $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; |
| 584 | else |
| 585 | $link .= 'title="' . attribute_escape( apply_filters( 'category_description', $category->category_description, $category )) . '"'; |
| 586 | $link .= '>'; |
| 587 | $link .= apply_filters( 'list_cats', $category->cat_name, $category ).'</a>'; |
| 588 | |
| 589 | if ( (! empty($feed_image)) || (! empty($feed)) ) { |
| 590 | $link .= ' '; |
| 591 | |
| 592 | if ( empty($feed_image) ) |
| 593 | $link .= '('; |
| 594 | |
| 595 | $link .= '<a href="' . get_category_rss_link( 0, $category->cat_ID, $category->category_nicename ) . '"'; |
| 596 | |
| Line | Code |
| 649 | } |
| 650 | |
| 651 | class Walker_CategoryDropdown extends Walker { |
| 652 | var $tree_type = 'category'; |
| 653 | var $db_fields = array ('parent' => 'category_parent', 'id' => 'cat_ID'); //TODO: decouple this |
| 654 | |
| 655 | function start_el($output, $category, $depth, $args) { |
| 656 | $pad = str_repeat(' ', $depth * 3); |
| 657 | |
| 658 | $cat_name = apply_filters('list_cats', $category->cat_name, $category); |
| 659 | $output .= "\t<option value=\"".$category->cat_ID."\""; |
| 660 | if ( $category->cat_ID == $args['selected'] ) |
| 661 | $output .= ' selected="selected"'; |
| 662 | $output .= '>'; |
| 663 | $output .= $pad.$cat_name; |
| 664 | if ( $args['show_count'] ) |
| 665 | $output .= ' ('. $category->category_count .')'; |
| 666 | if ( $args['show_last_update'] ) { |
| 667 | $format = 'Y-m-d'; |