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 |
|---|---|
| 345 | |
| 346 | if ( is_attachment() ) |
| 347 | $post = & get_post($GLOBALS['post']->post_parent); |
| 348 | else |
| 349 | $post = get_previous_post($in_same_cat, $excluded_categories); |
| 350 | |
| 351 | if ( !$post ) |
| 352 | return; |
| 353 | |
| 354 | $title = apply_filters('the_title', $post->post_title, $post); |
| 355 | $string = '<a href="'.get_permalink($post->ID).'">'; |
| 356 | $link = str_replace('%title', $title, $link); |
| 357 | $link = $pre . $string . $link . '</a>'; |
| 358 | |
| 359 | $format = str_replace('%link', $link, $format); |
| 360 | |
| 361 | echo $format; |
| 362 | } |
| 363 | |
| 364 | function next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') { |
| 365 | $post = get_next_post($in_same_cat, $excluded_categories); |
| 366 | |
| 367 | if ( !$post ) |
| 368 | return; |
| 369 | |
| 370 | $title = apply_filters('the_title', $post->post_title, $post); |
| 371 | $string = '<a href="'.get_permalink($post->ID).'">'; |
| 372 | $link = str_replace('%title', $title, $link); |
| 373 | $link = $string . $link . '</a>'; |
| 374 | $format = str_replace('%link', $link, $format); |
| 375 | |
| 376 | echo $format; |
| 377 | } |
| 378 | |
| 379 | function get_pagenum_link($pagenum = 1) { |