Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: single_tag_title

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
443           if ( $cat )
444                $title = apply_filters('single_cat_title', $cat->name);
445      }
446
447      if ( !empty($tag) ) {
448           $tag = get_term($tag, 'post_tag', OBJECT, 'display');
449           if ( is_wp_error( $tag ) )
450                return $tag;
451           if ( ! empty($tag->name) )
452                $title = apply_filters('single_tag_title', $tag->name);
453      }
454
455      // If there's an author
456      if ( !empty($author) ) {
457           $title = get_userdata($author);
458           $title = $title->display_name;
459      }
460      if ( !empty($author_name) ) {
461           // We do a direct query here because we don't cache by nicename.
 
Line Code
617      if ( !is_tag() )
618           return;
619
620      $tag_id = intval( get_query_var('tag_id') );
621
622      if ( !empty($tag_id) ) {
623           $my_tag = &get_term($tag_id, 'post_tag', OBJECT, 'display');
624           if ( is_wp_error( $my_tag ) )
625                return false;
626           $my_tag_name = apply_filters('single_tag_title', $my_tag->name);
627           if ( !empty($my_tag_name) ) {
628                if ( $display )
629                     echo $prefix . $my_tag_name;
630                else
631                     return $my_tag_name;
632           }
633      }
634 }
635