summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wp-includes/post-template.php11
-rw-r--r--wp-includes/script-loader.php2
2 files changed, 12 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];
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index dc6c68e..06330e4 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -188,6 +188,8 @@ class _WP_Script {
*/
function wp_print_scripts( $handles = false ) {
do_action( 'wp_print_scripts' );
+ if ( '' === $handles ) // for wp_head
+ $handles = false;
global $wp_scripts;
if ( !is_a($wp_scripts, 'WP_Scripts') ) {