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