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
190           if ( !empty($monthnum) )
191                $title .= " $sep ".$month[zeroise($monthnum, 2)];
192           if ( !empty($day) )
193                $title .= " $sep ".zeroise($day, 2);
194      }
195
196      // If there is a post
197      if ( is_single() || is_page() ) {
198           $title = strip_tags($posts[0]->post_title);
199           $title = apply_filters('single_post_title', $title);
200      }
201
202      $prefix = '';
203      if ( !empty($title) )
204           $prefix = " $sep ";
205
206      $title = $prefix . $title;
207      $title = apply_filters('wp_title', $title, $sep);
208
 
Line Code
218      global $wpdb;
219      $p = get_query_var('p');
220      $name = get_query_var('name');
221
222      if ( intval($p) || '' != $name ) {
223           if ( !$p )
224                $p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$name'");
225           $post = & get_post($p);
226           $title = $post->post_title;
227           $title = apply_filters('single_post_title', $title);
228           if ( $display )
229                echo $prefix.strip_tags($title);
230           else
231                return strip_tags($title);
232      }
233 }
234
235
236 function single_cat_title($prefix = '', $display = true ) {