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 |
|---|---|
| 142 | $in_same_cat = true; |
| 143 | |
| 144 | $post = get_previous_post($in_same_cat, $excluded_categories); |
| 145 | |
| 146 | if ( !$post ) |
| 147 | return; |
| 148 | |
| 149 | $string = '<a href="'.get_permalink($post->ID).'">'.$previous; |
| 150 | if ( 'yes' == $title ) |
| 151 | $string .= apply_filters('the_title', $post->post_title, $post->ID); |
| 152 | $string .= '</a>'; |
| 153 | $format = str_replace('%', $string, $format); |
| 154 | echo $format; |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Prints link to the next post. |
| 159 | * |
| 160 | * @since 0.71 |
| Line | Code |
| 177 | $in_same_cat = true; |
| 178 | |
| 179 | $post = get_next_post($in_same_cat, $excluded_categories); |
| 180 | |
| 181 | if ( !$post ) |
| 182 | return; |
| 183 | |
| 184 | $string = '<a href="'.get_permalink($post->ID).'">'.$next; |
| 185 | if ( 'yes' == $title ) |
| 186 | $string .= apply_filters('the_title', $post->post_title, $post->ID); |
| 187 | $string .= '</a>'; |
| 188 | $format = str_replace('%', $string, $format); |
| 189 | echo $format; |
| 190 | } |
| 191 | |
| 192 | /** |
| 193 | * Whether user can create a post. |
| 194 | * |
| 195 | * @since 1.5.0 |
| Line | Code |
| 2703 | $post = $posts[0]; |
| 2704 | |
| 2705 | if ( empty($post->post_title) ) |
| 2706 | $post->post_title = $start ? __('First Post') : __('Last Post'); |
| 2707 | |
| 2708 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 2709 | |
| 2710 | $title = str_replace('%title', $post->post_title, $title); |
| 2711 | $title = str_replace('%date', $date, $title); |
| 2712 | $title = apply_filters('the_title', $title, $post->ID); |
| 2713 | |
| 2714 | $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; |
| 2715 | $link .= esc_attr($title); |
| 2716 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 2717 | |
| 2718 | $boundary = $start ? 'start' : 'end'; |
| 2719 | return apply_filters( "{$boundary}_post_rel_link", $link ); |
| 2720 | } |
| 2721 | |
| Line | Code |
| 2778 | $post = get_post($GLOBALS['post']->post_parent); |
| 2779 | |
| 2780 | if ( empty($post) ) |
| 2781 | return; |
| 2782 | |
| 2783 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 2784 | |
| 2785 | $title = str_replace('%title', $post->post_title, $title); |
| 2786 | $title = str_replace('%date', $date, $title); |
| 2787 | $title = apply_filters('the_title', $title, $post->ID); |
| 2788 | |
| 2789 | $link = "<link rel='up' title='"; |
| 2790 | $link .= esc_attr( $title ); |
| 2791 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 2792 | |
| 2793 | return apply_filters( "parent_post_rel_link", $link ); |
| 2794 | } |
| 2795 | |
| 2796 | /** |