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
168         }
169         if (!empty($day)) {
170             $title .= " $sep ".zeroise($day, 2);
171         }
172     }
173
174     // If there's a post
175     if (is_single() || is_page()) {
176         $title = strip_tags($posts[0]->post_title);
177         $title = apply_filters('single_post_title', $title);
178     }
179
180     // Send it out
181     if ($display && isset($title)) {
182         echo " $sep $title";
183     } elseif (!$display && isset($title)) {
184         return " $sep $title";
185     }
186 }
 
Line Code
189     global $wpdb;
190           $p = get_query_var('p');
191           $name = get_query_var('name');
192     if (intval($p) || '' != $name) {
193         if (!$p) {
194             $p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$name'");
195         }
196         $post = & get_post($p);
197         $title = $post->post_title;
198         $title = apply_filters('single_post_title', $title);
199         if ($display) {
200             echo $prefix.strip_tags($title);
201         } else {
202             return strip_tags($title);
203         }
204     }
205 }
206
207 function single_cat_title($prefix = '', $display = true ) {