From 989ddc7360b45d5aa35b8aa97bc5f865f468f547 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 16 Apr 2009 19:43:01 +0000 Subject: [PATCH] Fix teaser stripping when no teaser. Props makibo, simonwheatley. fixes #6312 git-svn-id: http://svn.automattic.com/wordpress/trunk@10954 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 6491217cd..20cb21707 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -183,6 +183,7 @@ function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = $more_link_text = __( '(more...)' ); $output = ''; + $hasTeaser = false; // If post password required and it doesn't match the cookie. if ( post_password_required($post) ) { @@ -203,13 +204,15 @@ function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = $content = explode($matches[0], $content, 2); if ( !empty($matches[1]) && !empty($more_link_text) ) $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1]))); + + $hasTeaser = true; } else { $content = array($content); } if ( (false !== strpos($post->post_content, '') && ((!$multipage) || ($page==1))) ) $stripteaser = 1; $teaser = $content[0]; - if ( ($more) && ($stripteaser) ) + if ( ($more) && ($stripteaser) && ($hasTeaser) ) $teaser = ''; $output .= $teaser; if ( count($content) > 1 ) {