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 |
|---|---|
| 475 | if ( !empty($monthnum) ) |
| 476 | $title .= "$t_sep" . $wp_locale->get_month($monthnum); |
| 477 | if ( !empty($day) ) |
| 478 | $title .= "$t_sep" . zeroise($day, 2); |
| 479 | } |
| 480 | |
| 481 | // If there is a post |
| 482 | if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) { |
| 483 | $post = $wp_query->get_queried_object(); |
| 484 | $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) ); |
| 485 | } |
| 486 | |
| 487 | // If there's a taxonomy |
| 488 | if ( is_tax() ) { |
| 489 | $taxonomy = get_query_var( 'taxonomy' ); |
| 490 | $tax = get_taxonomy( $taxonomy ); |
| 491 | $tax = $tax->label; |
| 492 | $term = $wp_query->get_queried_object(); |
| 493 | $term = $term->name; |
| Line | Code |
| 550 | global $wpdb; |
| 551 | $p = get_query_var('p'); |
| 552 | $name = get_query_var('name'); |
| 553 | |
| 554 | if ( intval($p) || '' != $name ) { |
| 555 | if ( !$p ) |
| 556 | $p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name)); |
| 557 | $post = & get_post($p); |
| 558 | $title = $post->post_title; |
| 559 | $title = apply_filters('single_post_title', $title); |
| 560 | if ( $display ) |
| 561 | echo $prefix.strip_tags($title); |
| 562 | else |
| 563 | return strip_tags($title); |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | /** |
| 568 | * Display or retrieve page title for category archive. |