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
224           if ( !empty($monthnum) )
225                $title .= " $sep " . $wp_locale->get_month($monthnum);
226           if ( !empty($day) )
227                $title .= " $sep " . zeroise($day, 2);
228      }
229
230      // If there is a post
231      if ( is_single() || is_page() ) {
232           $post = $wp_query->get_queried_object();
233           $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
234      }
235
236      // If there's a taxonomy
237      if ( is_tax() ) {
238           $taxonomy = get_query_var( 'taxonomy' );
239           $tax = get_taxonomy( $taxonomy );
240           $tax = $tax->label;
241           $term = $wp_query->get_queried_object();
242           $term = $term->name;
 
Line Code
271      global $wpdb;
272      $p = get_query_var('p');
273      $name = get_query_var('name');
274
275      if ( intval($p) || '' != $name ) {
276           if ( !$p )
277                $p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name));
278           $post = & get_post($p);
279           $title = $post->post_title;
280           $title = apply_filters('single_post_title', $title);
281           if ( $display )
282                echo $prefix.strip_tags($title);
283           else
284                return strip_tags($title);
285      }
286 }
287
288
289 function single_cat_title($prefix = '', $display = true ) {