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
1075           return;
1076
1077      if ( empty($post->post_title) )
1078           $post->post_title = $previous ? __('Previous Post') : __('Next Post');
1079
1080      $date = mysql2date(get_option('date_format'), $post->post_date);
1081
1082      $title = str_replace('%title', $post->post_title, $title);
1083      $title = str_replace('%date', $date, $title);
1084      $title = apply_filters('the_title', $title, $post->ID);
1085
1086      $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='";
1087      $link .= esc_attr( $title );
1088      $link .= "' href='" . get_permalink($post) . "' />\n";
1089
1090      $adjacent = $previous ? 'previous' : 'next';
1091      return apply_filters( "{$adjacent}_post_rel_link", $link );
1092 }
1093
 
Line Code
1213      $post = $posts[0];
1214
1215      if ( empty($post->post_title) )
1216           $post->post_title = $start ? __('First Post') : __('Last Post');
1217
1218      $date = mysql2date(get_option('date_format'), $post->post_date);
1219
1220      $title = str_replace('%title', $post->post_title, $title);
1221      $title = str_replace('%date', $date, $title);
1222      $title = apply_filters('the_title', $title, $post->ID);
1223
1224      $link = $start ? "<link rel='start' title='" : "<link rel='end' title='";
1225      $link .= esc_attr($title);
1226      $link .= "' href='" . get_permalink($post) . "' />\n";
1227
1228      $boundary = $start ? 'start' : 'end';
1229      return apply_filters( "{$boundary}_post_rel_link", $link );
1230 }
1231
 
Line Code
1276           $post = & get_post($GLOBALS['post']->post_parent);
1277
1278      if ( empty($post) )
1279           return;
1280
1281      $date = mysql2date(get_option('date_format'), $post->post_date);
1282
1283      $title = str_replace('%title', $post->post_title, $title);
1284      $title = str_replace('%date', $date, $title);
1285      $title = apply_filters('the_title', $title, $post->ID);
1286
1287      $link = "<link rel='up' title='";
1288      $link .= esc_attr( $title );
1289      $link .= "' href='" . get_permalink($post) . "' />\n";
1290
1291      return apply_filters( "parent_post_rel_link", $link );
1292 }
1293
1294 /**
 
Line Code
1349
1350      if ( !$post )
1351           return;
1352
1353      $title = $post->post_title;
1354
1355      if ( empty($post->post_title) )
1356           $title = $previous ? __('Previous Post') : __('Next Post');
1357
1358      $title = apply_filters('the_title', $title, $post->ID);
1359      $date = mysql2date(get_option('date_format'), $post->post_date);
1360      $rel = $previous ? 'prev' : 'next';
1361
1362      $string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">';
1363      $link = str_replace('%title', $title, $link);
1364      $link = str_replace('%date', $date, $link);
1365      $link = $string . $link . '</a>';
1366
1367      $format = str_replace('%link', $link, $format);