diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php
index 1ae90b4506..244cad0deb 100644
--- a/wp-includes/class-wp-xmlrpc-server.php
+++ b/wp-includes/class-wp-xmlrpc-server.php
@@ -3953,6 +3953,7 @@ class wp_xmlrpc_server extends IXR_Server {
'categories' => $categories,
'mt_excerpt' => $postdata['post_excerpt'],
'mt_text_more' => $post['extended'],
+ 'wp_more_text' => $post['more_text'],
'mt_allow_comments' => $allow_comments,
'mt_allow_pings' => $allow_pings,
'mt_keywords' => $tagnames,
@@ -4069,6 +4070,7 @@ class wp_xmlrpc_server extends IXR_Server {
'categories' => $categories,
'mt_excerpt' => $entry['post_excerpt'],
'mt_text_more' => $post['extended'],
+ 'wp_more_text' => $post['more_text'],
'mt_allow_comments' => $allow_comments,
'mt_allow_pings' => $allow_pings,
'mt_keywords' => $tagnames,
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 3fcaa46edc..e2ef3888b5 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -328,29 +328,32 @@ function get_children($args = '', $output = OBJECT) {
* 'more'. There can be text or space(s) after the word 'more', but won't be
* referenced.
*
- * The returned array has 'main' and 'extended' keys. Main has the text before
+ * The returned array has 'main', 'extended', and 'more_text' keys. Main has the text before
* the
. The 'extended' key has the content after the
- *
comment.
+ *
comment. The 'more_text' key has the custom "Read More" text.
*
* @since 1.0.0
*
* @param string $post Post content.
- * @return array Post before ('main') and after ('extended').
+ * @return array Post before ('main'), after ('extended'), and custom readmore ('more_text').
*/
function get_extended($post) {
//Match the new style more links
if ( preg_match('//', $post, $matches) ) {
list($main, $extended) = explode($matches[0], $post, 2);
+ $more_text = $matches[1];
} else {
$main = $post;
$extended = '';
+ $more_text = '';
}
// Strip leading and trailing whitespace
$main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main);
$extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended);
+ $more_text = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $more_text);
- return array('main' => $main, 'extended' => $extended);
+ return array( 'main' => $main, 'extended' => $extended, 'more_text' => $more_text );
}
/**