diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-21 10:34:04 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-21 10:34:04 +0000 |
commit | 3cdac022a506c1192454ea6ea45d8009b2d5fdeb (patch) | |
tree | 10f9788d03afab8a9ac8cd510ec13b8649cb7ab6 /wp-includes/post-template.php | |
parent | e9261c6491959b5b0efe1036ec37ff9e850bd62e (diff) | |
download | wordpress-mu-3cdac022a506c1192454ea6ea45d8009b2d5fdeb.tar.gz wordpress-mu-3cdac022a506c1192454ea6ea45d8009b2d5fdeb.tar.xz wordpress-mu-3cdac022a506c1192454ea6ea45d8009b2d5fdeb.zip |
WP Merge to rev 4106
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@724 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/post-template.php')
-rw-r--r-- | wp-includes/post-template.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index fcd3f89..58ba562 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -76,8 +76,17 @@ function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_ else $file = $pagenow; //$_SERVER['PHP_SELF']; + if ( $page > count($pages) ) // if the requested page doesn't exist + $page = count($pages); // give them the highest numbered page that DOES exist + $content = $pages[$page-1]; - $content = explode('<!--more-->', $content, 2); + if ( preg_match('/<!--more(.+?)?-->/', $content, $matches) ) { + $content = explode($matches[0], $content, 2); + if ( !empty($matches[1]) ) + $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1]))); + } else { + $content = array($content); + } if ( (false !== strpos($post->post_content, '<!--noteaser-->') && ((!$multipage) || ($page==1))) ) $stripteaser = 1; $teaser = $content[0]; |