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 |
---|---|
1185 | return; |
1186 |
|
1187 | if ( empty($post->post_title) ) |
1188 | $post->post_title = $previous ? __('Previous Post') : __('Next Post'); |
1189 |
|
1190 | $date = mysql2date(get_option('date_format'), $post->post_date); |
1191 |
|
1192 | $title = str_replace('%title', $post->post_title, $title); |
1193 | $title = str_replace('%date', $date, $title); |
1194 | $title = apply_filters('the_title', $title, $post->ID); |
1195 |
|
1196 | $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='"; |
1197 | $link .= esc_attr( $title ); |
1198 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
1199 |
|
1200 | $adjacent = $previous ? 'previous' : 'next'; |
1201 | return apply_filters( "{$adjacent}_post_rel_link", $link ); |
1202 | } |
1203 |
|
Line | Code |
1348 |
|
1349 | if ( !$post ) |
1350 | return; |
1351 |
|
1352 | $title = $post->post_title; |
1353 |
|
1354 | if ( empty($post->post_title) ) |
1355 | $title = $previous ? __('Previous Post') : __('Next Post'); |
1356 |
|
1357 | $title = apply_filters('the_title', $title, $post->ID); |
1358 | $date = mysql2date(get_option('date_format'), $post->post_date); |
1359 | $rel = $previous ? 'prev' : 'next'; |
1360 |
|
1361 | $string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">'; |
1362 | $link = str_replace('%title', $title, $link); |
1363 | $link = str_replace('%date', $date, $link); |
1364 | $link = $string . $link . '</a>'; |
1365 |
|
1366 | $format = str_replace('%link', $link, $format); |