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 3 times in this file.

Line Code
15 ?>
16 <div class="wrap">
17 <?php if ($drafts) { ?>
18      <p><strong><?php _e('Your Drafts:') ?></strong>
19      <?php
20      $i = 0;
21      foreach ($drafts as $draft) {
22           if (0 != $i)
23                echo ', ';
24           $draft->post_title = apply_filters('the_title', stripslashes($draft->post_title));
25           if ($draft->post_title == '')
26                $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
27           echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
28           ++$i;
29           }
30      ?>
31 .</p>
32 <?php } ?>
33
34 <?php if ($other_drafts) { ?>
35      <p><strong><?php _e('Other&#8217;s Drafts:') ?></strong>
36      <?php
37      $i = 0;
38      foreach ($other_drafts as $draft) {
39           if (0 != $i)
40                echo ', ';
41           $draft->post_title = apply_filters('the_title', stripslashes($draft->post_title));
42           if ($draft->post_title == '')
43                $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
44           echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
45           ++$i;
46           }
47      ?>
48      .</p>
49
50 <?php } ?>
 
Line Code
58
59 wp('what_to_show=posts&posts_per_page=15&posts_per_archive_page=-1');
60
61 if ( is_month() ) {
62      single_month_title(' ');
63 } elseif ( is_search() ) {
64      printf(__('Search for &#8220;%s&#8221;'), wp_specialchars($_GET['s']) );
65 } else {
66      if ( is_single() )
67           printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title));
68      elseif ( ! is_paged() || get_query_var('paged') == 1 )
69           _e('Last 15 Posts');
70      else
71           _e('Previous Posts');
72 }
73 ?>
74 </h2>
75
76 <form name="searchform" id="searchform" action="" method="get">