Changeset 20156
- Timestamp:
- 03/08/2012 12:50:21 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r20155 r20156 3954 3954 'mt_excerpt' => $postdata['post_excerpt'], 3955 3955 'mt_text_more' => $post['extended'], 3956 'wp_more_text' => $post['more_text'], 3956 3957 'mt_allow_comments' => $allow_comments, 3957 3958 'mt_allow_pings' => $allow_pings, … … 4070 4071 'mt_excerpt' => $entry['post_excerpt'], 4071 4072 'mt_text_more' => $post['extended'], 4073 'wp_more_text' => $post['more_text'], 4072 4074 'mt_allow_comments' => $allow_comments, 4073 4075 'mt_allow_pings' => $allow_pings, -
trunk/wp-includes/post.php
r20075 r20156 329 329 * referenced. 330 330 * 331 * The returned array has 'main' and 'extended' keys. Main has the text before331 * The returned array has 'main', 'extended', and 'more_text' keys. Main has the text before 332 332 * the <code><!--more--></code>. The 'extended' key has the content after the 333 * <code><!--more--></code> comment. 333 * <code><!--more--></code> comment. The 'more_text' key has the custom "Read More" text. 334 334 * 335 335 * @since 1.0.0 336 336 * 337 337 * @param string $post Post content. 338 * @return array Post before ('main') and after ('extended').338 * @return array Post before ('main'), after ('extended'), and custom readmore ('more_text'). 339 339 */ 340 340 function get_extended($post) { … … 342 342 if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) ) { 343 343 list($main, $extended) = explode($matches[0], $post, 2); 344 $more_text = $matches[1]; 344 345 } else { 345 346 $main = $post; 346 347 $extended = ''; 348 $more_text = ''; 347 349 } 348 350 … … 350 352 $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main); 351 353 $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended); 352 353 return array('main' => $main, 'extended' => $extended); 354 $more_text = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $more_text); 355 356 return array( 'main' => $main, 'extended' => $extended, 'more_text' => $more_text ); 354 357 } 355 358
Note: See TracChangeset
for help on using the changeset viewer.