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 4 times in this file.
| Line | Code |
|---|---|
| 1174 | return; |
| 1175 | |
| 1176 | if ( empty($post->post_title) ) |
| 1177 | $post->post_title = $previous ? __('Previous Post') : __('Next Post'); |
| 1178 | |
| 1179 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1180 | |
| 1181 | $title = str_replace('%title', $post->post_title, $title); |
| 1182 | $title = str_replace('%date', $date, $title); |
| 1183 | $title = apply_filters('the_title', $title, $post->ID); |
| 1184 | |
| 1185 | $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='"; |
| 1186 | $link .= esc_attr( $title ); |
| 1187 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 1188 | |
| 1189 | $adjacent = $previous ? 'previous' : 'next'; |
| 1190 | return apply_filters( "{$adjacent}_post_rel_link", $link ); |
| 1191 | } |
| 1192 | |
| Line | Code |
| 1312 | $post = $posts[0]; |
| 1313 | |
| 1314 | if ( empty($post->post_title) ) |
| 1315 | $post->post_title = $start ? __('First Post') : __('Last Post'); |
| 1316 | |
| 1317 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1318 | |
| 1319 | $title = str_replace('%title', $post->post_title, $title); |
| 1320 | $title = str_replace('%date', $date, $title); |
| 1321 | $title = apply_filters('the_title', $title, $post->ID); |
| 1322 | |
| 1323 | $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; |
| 1324 | $link .= esc_attr($title); |
| 1325 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 1326 | |
| 1327 | $boundary = $start ? 'start' : 'end'; |
| 1328 | return apply_filters( "{$boundary}_post_rel_link", $link ); |
| 1329 | } |
| 1330 | |
| Line | Code |
| 1375 | $post = & get_post($GLOBALS['post']->post_parent); |
| 1376 | |
| 1377 | if ( empty($post) ) |
| 1378 | return; |
| 1379 | |
| 1380 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1381 | |
| 1382 | $title = str_replace('%title', $post->post_title, $title); |
| 1383 | $title = str_replace('%date', $date, $title); |
| 1384 | $title = apply_filters('the_title', $title, $post->ID); |
| 1385 | |
| 1386 | $link = "<link rel='up' title='"; |
| 1387 | $link .= esc_attr( $title ); |
| 1388 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 1389 | |
| 1390 | return apply_filters( "parent_post_rel_link", $link ); |
| 1391 | } |
| 1392 | |
| 1393 | /** |
| Line | Code |
| 1448 | |
| 1449 | if ( !$post ) |
| 1450 | return; |
| 1451 | |
| 1452 | $title = $post->post_title; |
| 1453 | |
| 1454 | if ( empty($post->post_title) ) |
| 1455 | $title = $previous ? __('Previous Post') : __('Next Post'); |
| 1456 | |
| 1457 | $title = apply_filters('the_title', $title, $post->ID); |
| 1458 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1459 | $rel = $previous ? 'prev' : 'next'; |
| 1460 | |
| 1461 | $string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">'; |
| 1462 | $link = str_replace('%title', $title, $link); |
| 1463 | $link = str_replace('%date', $date, $link); |
| 1464 | $link = $string . $link . '</a>'; |
| 1465 | |
| 1466 | $format = str_replace('%link', $link, $format); |