Make WordPress Core

Changeset 2538


Ignore:
Timestamp:
04/17/2005 05:09:19 PM (19 years ago)
Author:
ryan
Message:

Filter the title in next_post() and previous_post(). Mark next_post() and previous_post() as deprecated. Update the default theme to use next_post_link() and previous_post_link(). http://mosquito.wordpress.org/view.php?id=1241 Hat tip: wyrfel

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/default/single.php

    r2390 r2538  
    66   
    77        <div class="navigation">
    8             <div class="alignleft"><?php previous_post('&laquo; %','','yes') ?></div>
    9             <div class="alignright"><?php next_post(' % &raquo;','','yes') ?></div>
     8            <div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
     9            <div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
    1010        </div>
    1111   
  • trunk/wp-includes/template-functions-links.php

    r2523 r2538  
    294294}
    295295
     296// Deprecated.  Use previous_post_link().
    296297function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
    297298    global $id, $post, $wpdb;
     
    322323            $string = '<a href="'.get_permalink($lastpost->ID).'">'.$previous;
    323324            if ($title == 'yes') {
    324                 $string .= wptexturize($lastpost->post_title);
     325                            $string .= apply_filters('the_title', $lastpost->post_title, $lastpost);
    325326            }
    326327            $string .= '</a>';
     
    331332}
    332333
     334// Deprecated.  Use next_post_link().
    333335function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
    334336    global $posts_per_page, $post, $wpdb;
     
    360362            $string = '<a href="'.get_permalink($nextpost->ID).'">'.$next;
    361363            if ($title=='yes') {
    362                 $string .= wptexturize($nextpost->post_title);
     364                            $string .= apply_filters('the_title', $nextpost->post_title, $nextpost);
    363365            }
    364366            $string .= '</a>';
Note: See TracChangeset for help on using the changeset viewer.