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 |
|---|---|
| 88 | $in_same_cat = true; |
| 89 | |
| 90 | $post = get_previous_post($in_same_cat, $excluded_categories); |
| 91 | |
| 92 | if ( !$post ) |
| 93 | return; |
| 94 | |
| 95 | $string = '<a href="'.get_permalink($post->ID).'">'.$previous; |
| 96 | if ( 'yes' == $title ) |
| 97 | $string .= apply_filters('the_title', $post->post_title, $post); |
| 98 | $string .= '</a>'; |
| 99 | $format = str_replace('%', $string, $format); |
| 100 | echo $format; |
| 101 | } |
| 102 | |
| 103 | // Deprecated. Use next_post_link(). |
| 104 | function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { |
| 105 | |
| 106 | if ( empty($in_same_cat) || 'no' == $in_same_cat ) |
| Line | Code |
| 109 | $in_same_cat = true; |
| 110 | |
| 111 | $post = get_next_post($in_same_cat, $excluded_categories); |
| 112 | |
| 113 | if ( !$post ) |
| 114 | return; |
| 115 | |
| 116 | $string = '<a href="'.get_permalink($post->ID).'">'.$next; |
| 117 | if ( 'yes' == $title ) |
| 118 | $string .= apply_filters('the_title', $post->post_title, $nextpost); |
| 119 | $string .= '</a>'; |
| 120 | $format = str_replace('%', $string, $format); |
| 121 | echo $format; |
| 122 | } |
| 123 | |
| 124 | // |
| 125 | // These are deprecated. Use current_user_can(). |
| 126 | // |
| 127 | |