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 |
---|---|
264 | } |
265 |
|
266 | function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') { |
267 | $post = get_previous_post($in_same_cat, $excluded_categories); |
268 |
|
269 | if(! $post) { |
270 | return; |
271 | } |
272 |
|
273 | $title = apply_filters('the_title', $post->post_title, $post); |
274 |
|
275 | $string = '<a href="'.get_permalink($post->ID).'">'; |
276 |
|
277 | $link = str_replace('%title', $title, $link); |
278 |
|
279 | $link = $string . $link . '</a>'; |
280 |
|
281 | $format = str_replace('%link', $link, $format); |
282 |
|
Line | Code |
284 | } |
285 |
|
286 | function next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') { |
287 | $post = get_next_post($in_same_cat, $excluded_categories); |
288 |
|
289 | if(! $post) { |
290 | return; |
291 | } |
292 |
|
293 | $title = apply_filters('the_title', $post->post_title, $post); |
294 |
|
295 | $string = '<a href="'.get_permalink($post->ID).'">'; |
296 |
|
297 | $link = str_replace('%title', $title, $link); |
298 |
|
299 | $link = $string . $link . '</a>'; |
300 |
|
301 | $format = str_replace('%link', $link, $format); |
302 |
|
Line | Code |
313 |
|
314 | $post = get_previous_post($in_same_cat, $excluded_categories); |
315 |
|
316 | if(! $post) { |
317 | return; |
318 | } |
319 |
|
320 | $string = '<a href="'.get_permalink($post->ID).'">'.$previous; |
321 | if ($title == 'yes') { |
322 | $string .= apply_filters('the_title', $post->post_title, $post); |
323 | } |
324 | $string .= '</a>'; |
325 | $format = str_replace('%', $string, $format); |
326 | echo $format; |
327 | } |
328 |
|
329 | // Deprecated. Use next_post_link(). |
330 | function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { |
331 | |
Line | Code |
336 |
|
337 | $post = get_next_post($in_same_cat, $excluded_categories); |
338 |
|
339 | if(! $post) { |
340 | return; |
341 | } |
342 |
|
343 | $string = '<a href="'.get_permalink($post->ID).'">'.$next; |
344 | if ($title=='yes') { |
345 | $string .= apply_filters('the_title', $post->post_title, $nextpost); |
346 | } |
347 | $string .= '</a>'; |
348 | $format = str_replace('%', $string, $format); |
349 | echo $format; |
350 | } |
351 |
|
352 | function get_pagenum_link($pagenum = 1) { |
353 | global $wp_rewrite; |
354 |
|