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 |
|---|---|
| 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. |