WordPress.org

Make WordPress Core

Changeset 6082


Ignore:
Timestamp:
09/11/07 20:05:52 (8 years ago)
Author:
westi
Message:

Ensure (next|previous)_post_link always have some content even when the post title is blank. Fixes #1835, props johnbillion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r6068 r6082  
    433433        return; 
    434434 
    435     $title = apply_filters('the_title', $post->post_title, $post); 
     435    $title = $post->post_title; 
     436 
     437    if ( empty($post->post_title) ) 
     438        $title = __('Previous Post'); 
     439 
     440    $title = apply_filters('the_title', $title, $post); 
    436441    $string = '<a href="'.get_permalink($post->ID).'">'; 
    437442    $link = str_replace('%title', $title, $link); 
     
    449454        return; 
    450455 
    451     $title = apply_filters('the_title', $post->post_title, $post); 
     456    $title = $post->post_title; 
     457 
     458    if ( empty($post->post_title) ) 
     459        $title = __('Next Post'); 
     460 
     461    $title = apply_filters('the_title', $title, $post); 
    452462    $string = '<a href="'.get_permalink($post->ID).'">'; 
    453463    $link = str_replace('%title', $title, $link); 
Note: See TracChangeset for help on using the changeset viewer.