WordPress.org

Make WordPress Core

Ticket #11343: posts_nav_link.diff

File posts_nav_link.diff, 847 bytes (added by ShaneF, 8 years ago)
  • link-template.php

     
    15321532 * @param string $sep Optional. Separator for posts navigation links.
    15331533 * @param string $prelabel Optional. Label for previous pages.
    15341534 * @param string $nxtlabel Optional Label for next pages.
     1535 * @param bool $return Optional Return or echo the links. Default is echo.
    15351536 */
    1536 function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) {
     1537function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '', $return = false ) {
    15371538        $args = array_filter( compact('sep', 'prelabel', 'nxtlabel') );
    1538         echo get_posts_nav_link($args);
     1539       
     1540        if ( $return )
     1541                return get_posts_nav_link($args);
     1542        else
     1543                echo get_posts_nav_link($args);
     1544               
    15391545}
    15401546
    15411547/**