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 |
|---|---|
| 939 | return; |
| 940 | |
| 941 | if ( empty($post->post_title) ) |
| 942 | $post->post_title = $previous ? __('Previous Post') : __('Next Post'); |
| 943 | |
| 944 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 945 | |
| 946 | $title = str_replace('%title', $post->post_title, $title); |
| 947 | $title = str_replace('%date', $date, $title); |
| 948 | $title = apply_filters('the_title', $title, $post); |
| 949 | |
| 950 | $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='"; |
| 951 | $link .= esc_attr( $title ); |
| 952 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 953 | |
| 954 | $adjacent = $previous ? 'previous' : 'next'; |
| 955 | return apply_filters( "{$adjacent}_post_rel_link", $link ); |
| 956 | } |
| 957 | |
| Line | Code |
| 1063 | return; |
| 1064 | |
| 1065 | if ( empty($post->post_title) ) |
| 1066 | $post->post_title = $start ? __('First Post') : __('Last Post'); |
| 1067 | |
| 1068 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1069 | |
| 1070 | $title = str_replace('%title', $post->post_title, $title); |
| 1071 | $title = str_replace('%date', $date, $title); |
| 1072 | $title = apply_filters('the_title', $title, $post); |
| 1073 | |
| 1074 | $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; |
| 1075 | $link .= esc_attr($title); |
| 1076 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 1077 | |
| 1078 | $boundary = $start ? 'start' : 'end'; |
| 1079 | return apply_filters( "{$boundary}_post_rel_link", $link ); |
| 1080 | } |
| 1081 | |
| Line | Code |
| 1126 | $post = & get_post($GLOBALS['post']->post_parent); |
| 1127 | |
| 1128 | if ( empty($post) ) |
| 1129 | return; |
| 1130 | |
| 1131 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1132 | |
| 1133 | $title = str_replace('%title', $post->post_title, $title); |
| 1134 | $title = str_replace('%date', $date, $title); |
| 1135 | $title = apply_filters('the_title', $title, $post); |
| 1136 | |
| 1137 | $link = "<link rel='up' title='"; |
| 1138 | $link .= esc_attr( $title ); |
| 1139 | $link .= "' href='" . get_permalink($post) . "' />\n"; |
| 1140 | |
| 1141 | return apply_filters( "parent_post_rel_link", $link ); |
| 1142 | } |
| 1143 | |
| 1144 | /** |
| Line | Code |
| 1199 | |
| 1200 | if ( !$post ) |
| 1201 | return; |
| 1202 | |
| 1203 | $title = $post->post_title; |
| 1204 | |
| 1205 | if ( empty($post->post_title) ) |
| 1206 | $title = $previous ? __('Previous Post') : __('Next Post'); |
| 1207 | |
| 1208 | $title = apply_filters('the_title', $title, $post); |
| 1209 | $date = mysql2date(get_option('date_format'), $post->post_date); |
| 1210 | |
| 1211 | $string = '<a href="'.get_permalink($post).'">'; |
| 1212 | $link = str_replace('%title', $title, $link); |
| 1213 | $link = str_replace('%date', $date, $link); |
| 1214 | $link = $string . $link . '</a>'; |
| 1215 | |
| 1216 | $format = str_replace('%link', $link, $format); |
| 1217 | |