Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: the_title

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 4 times in this file.

Line Code
996           return;
997
998      if ( empty($post->post_title) )
999           $post->post_title = $previous ? __('Previous Post') : __('Next Post');
1000
1001      $date = mysql2date(get_option('date_format'), $post->post_date);
1002
1003      $title = str_replace('%title', $post->post_title, $title);
1004      $title = str_replace('%date', $date, $title);
1005      $title = apply_filters('the_title', $title, $post);
1006
1007      $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='";
1008      $link .= esc_attr( $title );
1009      $link .= "' href='" . get_permalink($post) . "' />\n";
1010
1011      $adjacent = $previous ? 'previous' : 'next';
1012      return apply_filters( "{$adjacent}_post_rel_link", $link );
1013 }
1014
 
Line Code
1120                 return;
1121
1122           if ( empty($post->post_title) )
1123                     $post->post_title = $start ? __('First Post') : __('Last Post');
1124
1125      $date = mysql2date(get_option('date_format'), $post->post_date);
1126
1127      $title = str_replace('%title', $post->post_title, $title);
1128      $title = str_replace('%date', $date, $title);
1129      $title = apply_filters('the_title', $title, $post);
1130
1131      $link = $start ? "<link rel='start' title='" : "<link rel='end' title='";
1132      $link .= esc_attr($title);
1133      $link .= "' href='" . get_permalink($post) . "' />\n";
1134
1135      $boundary = $start ? 'start' : 'end';
1136      return apply_filters( "{$boundary}_post_rel_link", $link );
1137 }
1138
 
Line Code
1183           $post = & get_post($GLOBALS['post']->post_parent);
1184
1185      if ( empty($post) )
1186           return;
1187
1188      $date = mysql2date(get_option('date_format'), $post->post_date);
1189
1190      $title = str_replace('%title', $post->post_title, $title);
1191      $title = str_replace('%date', $date, $title);
1192      $title = apply_filters('the_title', $title, $post);
1193
1194      $link = "<link rel='up' title='";
1195      $link .= esc_attr( $title );
1196      $link .= "' href='" . get_permalink($post) . "' />\n";
1197
1198      return apply_filters( "parent_post_rel_link", $link );
1199 }
1200
1201 /**
 
Line Code
1256
1257      if ( !$post )
1258           return;
1259
1260      $title = $post->post_title;
1261
1262      if ( empty($post->post_title) )
1263           $title = $previous ? __('Previous Post') : __('Next Post');
1264
1265      $title = apply_filters('the_title', $title, $post);
1266      $date = mysql2date(get_option('date_format'), $post->post_date);
1267      $rel = $previous ? 'prev' : 'next';
1268
1269      $string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">';
1270      $link = str_replace('%title', $title, $link);
1271      $link = str_replace('%date', $date, $link);
1272      $link = $string . $link . '</a>';
1273
1274      $format = str_replace('%link', $link, $format);