From f666759471e8511f88603fcad213c0340c7a16e1 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 11 Sep 2006 23:59:00 +0000 Subject: [PATCH] Show more link in RSS. Don't show more link if more link text empty. Take more into account when creating excerpt. git-svn-id: http://svn.automattic.com/wordpress/trunk@4184 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 2 +- wp-includes/post-template.php | 12 ++++++++---- wp-rss2.php | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 0f5cc74aba..6094dcb15a 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -741,7 +741,7 @@ function human_time_diff( $from, $to = '' ) { function wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; if ( '' == $text ) { - $text = $post->post_content; + $text = get_the_content(''); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $text = strip_tags($text); diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 8207720b67..f0d1eab562 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -82,7 +82,7 @@ function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_ $content = $pages[$page-1]; if ( preg_match('//', $content, $matches) ) { $content = explode($matches[0], $content, 2); - if ( !empty($matches[1]) ) + if ( !empty($matches[1]) && !empty($more_link_text) ) $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1]))); } else { $content = array($content); @@ -94,10 +94,14 @@ function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_ $teaser = ''; $output .= $teaser; if ( count($content) > 1 ) { - if ( $more ) + if ( $more ) { $output .= ''.$content[1]; - else - $output = balanceTags($output . ' $more_link_text"); + } else { + $output = balanceTags($output); + if ( ! empty($more_link_text) ) + $output .= ' $more_link_text"; + } + } if ( $preview ) // preview fix for javascript bug with foreign languages $output = preg_replace('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output); diff --git a/wp-rss2.php b/wp-rss2.php index ecbe721a45..baec198079 100644 --- a/wp-rss2.php +++ b/wp-rss2.php @@ -42,7 +42,7 @@ $more = 1; ]]> post_content ) > 0 ) : ?> - ]]> + ]]> ]]>