Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: category_description

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
168           $previouscat = $currentcat;
169      }
170 }
171
172 function category_description($category = 0) {
173      global $cat;
174      if ( !$category )
175           $category = $cat;
176      $category = & get_category($category);
177      return apply_filters('category_description', $category->category_description, $category->cat_ID);
178 }
179
180 // out of the WordPress loop
181 function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc',
182           $optiondates = 0, $optioncount = 0, $hide_empty = 1, $optionnone=FALSE,
183           $selected=0, $hide=0) {
184      global $wpdb;
185      if ( ($file == 'blah') || ($file == '') )
186           $file = get_settings('home') . '/';
 
Line Code
319      $thelist = "";
320
321      foreach ( $categories as $category ) {
322           if ( ( intval($hide_empty) == 0 || $category->category_count) && (!$hierarchical || $category->category_parent == $child_of) ) {
323                $num_found++;
324                $link = '<a href="'.get_category_link($category->cat_ID).'" ';
325                if ( $use_desc_for_title == 0 || empty($category->category_description) )
326                     $link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
327                else
328                     $link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category)) . '"';
329                $link .= '>';
330                $link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';
331
332                if ( (! empty($feed_image)) || (! empty($feed)) ) {
333
334                     $link .= ' ';
335
336                     if ( empty($feed_image) )
337                          $link .= '(';