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 |
---|---|
143 | $in_same_cat = true; |
144 |
|
145 | $post = get_previous_post($in_same_cat, $excluded_categories); |
146 |
|
147 | if ( !$post ) |
148 | return; |
149 |
|
150 | $string = '<a href="'.get_permalink($post->ID).'">'.$previous; |
151 | if ( 'yes' == $title ) |
152 | $string .= apply_filters('the_title', $post->post_title, $post->ID); |
153 | $string .= '</a>'; |
154 | $format = str_replace('%', $string, $format); |
155 | echo $format; |
156 | } |
157 |
|
158 | /** |
159 | * Prints link to the next post. |
160 | * |
161 | * @since 0.71 |
Line | Code |
179 | $in_same_cat = true; |
180 |
|
181 | $post = get_next_post($in_same_cat, $excluded_categories); |
182 |
|
183 | if ( !$post ) |
184 | return; |
185 |
|
186 | $string = '<a href="'.get_permalink($post->ID).'">'.$next; |
187 | if ( 'yes' == $title ) |
188 | $string .= apply_filters('the_title', $post->post_title, $post->ID); |
189 | $string .= '</a>'; |
190 | $format = str_replace('%', $string, $format); |
191 | echo $format; |
192 | } |
193 |
|
194 | /** |
195 | * Whether user can create a post. |
196 | * |
197 | * @since 1.5 |
Line | Code |
2715 | $post = $posts[0]; |
2716 |
|
2717 | if ( empty($post->post_title) ) |
2718 | $post->post_title = $start ? __('First Post') : __('Last Post'); |
2719 |
|
2720 | $date = mysql2date(get_option('date_format'), $post->post_date); |
2721 |
|
2722 | $title = str_replace('%title', $post->post_title, $title); |
2723 | $title = str_replace('%date', $date, $title); |
2724 | $title = apply_filters('the_title', $title, $post->ID); |
2725 |
|
2726 | $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; |
2727 | $link .= esc_attr($title); |
2728 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
2729 |
|
2730 | $boundary = $start ? 'start' : 'end'; |
2731 | return apply_filters( "{$boundary}_post_rel_link", $link ); |
2732 | } |
2733 |
|
Line | Code |
2790 | $post = get_post($GLOBALS['post']->post_parent); |
2791 |
|
2792 | if ( empty($post) ) |
2793 | return; |
2794 |
|
2795 | $date = mysql2date(get_option('date_format'), $post->post_date); |
2796 |
|
2797 | $title = str_replace('%title', $post->post_title, $title); |
2798 | $title = str_replace('%date', $date, $title); |
2799 | $title = apply_filters('the_title', $title, $post->ID); |
2800 |
|
2801 | $link = "<link rel='up' title='"; |
2802 | $link .= esc_attr( $title ); |
2803 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
2804 |
|
2805 | return apply_filters( "parent_post_rel_link", $link ); |
2806 | } |
2807 |
|
2808 | /** |