WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 211 | if ( !empty($monthnum) ) |
| 212 | $title .= " $sep " . $wp_locale->get_month($monthnum); |
| 213 | if ( !empty($day) ) |
| 214 | $title .= " $sep " . zeroise($day, 2); |
| 215 | } |
| 216 | |
| 217 | // If there is a post |
| 218 | if ( is_single() || is_page() ) { |
| 219 | $post = $wp_query->get_queried_object(); |
| 220 | $title = apply_filters('single_post_title', $title); |
| 221 | $title = strip_tags($post->post_title); |
| 222 | } |
| 223 | |
| 224 | $prefix = ''; |
| 225 | if ( !empty($title) ) |
| 226 | $prefix = " $sep "; |
| 227 | |
| 228 | $title = $prefix . $title; |
| 229 | $title = apply_filters('wp_title', $title, $sep); |
| Line | Code |
| 240 | global $wpdb; |
| 241 | $p = get_query_var('p'); |
| 242 | $name = get_query_var('name'); |
| 243 | |
| 244 | if ( intval($p) || '' != $name ) { |
| 245 | if ( !$p ) |
| 246 | $p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$name'"); |
| 247 | $post = & get_post($p); |
| 248 | $title = $post->post_title; |
| 249 | $title = apply_filters('single_post_title', $title); |
| 250 | if ( $display ) |
| 251 | echo $prefix.strip_tags($title); |
| 252 | else |
| 253 | return strip_tags($title); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | |
| 258 | function single_cat_title($prefix = '', $display = true ) { |