WordPress.org

Make WordPress Core

Changeset 4184


Ignore:
Timestamp:
09/11/2006 11:59:00 PM (12 years ago)
Author:
ryan
Message:

Show more link in RSS. Don't show more link if more link text empty. Take more into account when creating excerpt.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r4167 r4184  
    742742    global $post;
    743743    if ( '' == $text ) {
    744         $text = $post->post_content;
     744        $text = get_the_content('');
    745745        $text = apply_filters('the_content', $text);
    746746        $text = str_replace(']]>', ']]>', $text);
  • trunk/wp-includes/post-template.php

    r4180 r4184  
    8383    if ( preg_match('/<!--more(.+?)?-->/', $content, $matches) ) {
    8484        $content = explode($matches[0], $content, 2);
    85         if ( !empty($matches[1]) )
     85        if ( !empty($matches[1]) && !empty($more_link_text) )
    8686            $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1])));
    8787    } else {
     
    9595    $output .= $teaser;
    9696    if ( count($content) > 1 ) {
    97         if ( $more )
     97        if ( $more ) {
    9898            $output .= '<a id="more-'.$id.'"></a>'.$content[1];
    99         else
    100             $output = balanceTags($output . ' <a href="'. get_permalink() . "#more-$id\">$more_link_text</a>");
     99        } else {
     100            $output = balanceTags($output);
     101            if ( ! empty($more_link_text) )
     102                $output .= ' <a href="'. get_permalink() . "#more-$id\">$more_link_text</a>";
     103        }
     104           
    101105    }
    102106    if ( $preview ) // preview fix for javascript bug with foreign languages
  • trunk/wp-rss2.php

    r4144 r4184  
    4343        <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
    4444    <?php if ( strlen( $post->post_content ) > 0 ) : ?>
    45         <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
     45        <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
    4646    <?php else : ?>
    4747        <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
Note: See TracChangeset for help on using the changeset viewer.