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
163         echo $after;
164         $previouscat = $currentcat;
165     }
166 }
167
168 function category_description($category = 0) {
169     global $cat;
170     if (!$category) $category = $cat;
171           $category = & get_category($category);
172     return apply_filters('category_description', $category->category_description, $category->cat_ID);
173 }
174
175 // out of the WordPress loop
176 function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc',
177         $optiondates = 0, $optioncount = 0, $hide_empty = 1, $optionnone=FALSE,
178         $selected=0, $hide=0) {
179     global $wpdb;
180     if (($file == 'blah') || ($file == '')) $file = get_settings('home') . '/';
181     if (!$selected) $selected=$cat;
 
Line Code
309      $thelist = "";
310      
311      foreach ($categories as $category) {
312           if ((intval($hide_empty) == 0 || isset($category_posts["$category->cat_ID"])) && (!$hierarchical || $category->category_parent == $child_of) ) {
313                $num_found++;
314                $link = '<a href="'.get_category_link($category->cat_ID).'" ';
315                if ($use_desc_for_title == 0 || empty($category->category_description)) {
316                     $link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
317                } else {
318                     $link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category)) . '"';
319                }
320                $link .= '>';
321                $link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';
322
323                if ( (! empty($feed_image)) || (! empty($feed)) ) {
324                     
325                     $link .= ' ';
326
327                     if (empty($feed_image)) {