Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: list_cats

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1335       * @param string $output Passed by reference. Used to append additional content.
1336       * @param object $category Category data object.
1337       * @param int $depth Depth of category in reference to parents.
1338       * @param array $args
1339       */
1340      function start_el(&$output, $category, $depth, $args) {
1341           extract($args);
1342
1343           $cat_name = esc_attr( $category->name);
1344           $cat_name = apply_filters( 'list_cats', $cat_name, $category );
1345           $link = '<a href="' . get_term_link( $category, $category->taxonomy ) . '" ';
1346           if ( $use_desc_for_title == 0 || empty($category->description) )
1347                $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"';
1348           else
1349                $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"';
1350           $link .= '>';
1351           $link .= $cat_name . '</a>';
1352
1353           if ( (! empty($feed_image)) || (! empty($feed)) ) {
 
Line Code
1449       *
1450       * @param string $output Passed by reference. Used to append additional content.
1451       * @param object $category Category data object.
1452       * @param int $depth Depth of category. Used for padding.
1453       * @param array $args Uses 'selected', 'show_count', and 'show_last_update' keys, if they exist.
1454       */
1455      function start_el(&$output, $category, $depth, $args) {
1456           $pad = str_repeat('&nbsp;', $depth * 3);
1457
1458           $cat_name = apply_filters('list_cats', $category->name, $category);
1459           $output .= "\t<option class=\"level-$depth\" value=\"".$category->term_id."\"";
1460           if ( $category->term_id == $args['selected'] )
1461                $output .= ' selected="selected"';
1462           $output .= '>';
1463           $output .= $pad.$cat_name;
1464           if ( $args['show_count'] )
1465                $output .= '&nbsp;&nbsp;('. $category->count .')';
1466           if ( $args['show_last_update'] ) {
1467                $format = 'Y-m-d';