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