Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: single_post_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
428           if ( !empty($monthnum) )
429                $title .= "$t_sep" . $wp_locale->get_month($monthnum);
430           if ( !empty($day) )
431                $title .= "$t_sep" . zeroise($day, 2);
432      }
433
434      // If there is a post
435      if ( is_single() ||  ( is_page() && !is_front_page() ) ) {
436           $post = $wp_query->get_queried_object();
437           $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
438      }
439
440      // If there's a taxonomy
441      if ( is_tax() ) {
442           $taxonomy = get_query_var( 'taxonomy' );
443           $tax = get_taxonomy( $taxonomy );
444           $tax = $tax->label;
445           $term = $wp_query->get_queried_object();
446           $term = $term->name;
 
Line Code
497      global $wpdb;
498      $p = get_query_var('p');
499      $name = get_query_var('name');
500
501      if ( intval($p) || '' != $name ) {
502           if ( !$p )
503                $p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name));
504           $post = & get_post($p);
505           $title = $post->post_title;
506           $title = apply_filters('single_post_title', $title);
507           if ( $display )
508                echo $prefix.strip_tags($title);
509           else
510                return strip_tags($title);
511      }
512 }
513
514 /**
515  * Display or retrieve page title for category archive.