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 |
|---|---|
| 1220 | if ( empty($post->post_title) ) |
| 1221 | $post_title = $previous ? __('Previous Post') : __('Next Post'); |
| 1222 | else |
| 1223 | $post_title = $post->post_title; |
| 1224 | |
| 1225 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1226 | |
| 1227 | $title = str_replace('%title', $post_title, $title); |
| 1228 | $title = str_replace('%date', $date, $title); |
| 1229 | $title = apply_filters('the_title', $title, $post->ID); |
| 1230 | |
| 1231 | $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='"; |
| 1232 | $link .= esc_attr( $title ); |
| 1233 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 1234 | |
| 1235 | $adjacent = $previous ? 'previous' : 'next'; |
| 1236 | return apply_filters( "{$adjacent}_post_rel_link", $link ); |
| 1237 | } |
| 1238 | |
| Line | Code |
| 1382 | |
| 1383 | if ( ! $post ) { |
| 1384 | $output = ''; |
| 1385 | } else { |
| 1386 | $title = $post->post_title; |
| 1387 | |
| 1388 | if ( empty( $post->post_title ) ) |
| 1389 | $title = $previous ? __( 'Previous Post' ) : __( 'Next Post' ); |
| 1390 | |
| 1391 | $title = apply_filters( 'the_title', $title, $post->ID ); |
| 1392 | $date = mysql2date( get_option( 'date_format' ), $post->post_date ); |
| 1393 | $rel = $previous ? 'prev' : 'next'; |
| 1394 | |
| 1395 | $string = '<a href="' . get_permalink( $post ) . '" rel="'.$rel.'">'; |
| 1396 | $inlink = str_replace( '%title', $title, $link ); |
| 1397 | $inlink = str_replace( '%date', $date, $inlink ); |
| 1398 | $inlink = $string . $inlink . '</a>'; |
| 1399 | |
| 1400 | $output = str_replace( '%link', $inlink, $format ); |