summaryrefslogtreecommitdiffstats
path: root/wp-includes/post-template.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/post-template.php')
-rw-r--r--wp-includes/post-template.php11
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];