diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
index 3402e48..bc690d3 100644
|
|
|
add_filter( 'the_excerpt', 'convert_smilies' ); |
| 144 | 144 | add_filter( 'the_excerpt', 'convert_chars' ); |
| 145 | 145 | add_filter( 'the_excerpt', 'wpautop' ); |
| 146 | 146 | add_filter( 'the_excerpt', 'shortcode_unautop'); |
| 147 | | add_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); |
| | 147 | add_filter( 'get_the_excerpt', 'wp_trim_excerpt', 10, 2 ); |
| 148 | 148 | |
| 149 | 149 | add_filter( 'the_post_thumbnail_caption', 'wptexturize' ); |
| 150 | 150 | add_filter( 'the_post_thumbnail_caption', 'convert_smilies' ); |
diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
index 8318199..a8da79a 100644
|
|
|
function human_time_diff( $from, $to = '' ) { |
| 3261 | 3261 | * @since 1.5.0 |
| 3262 | 3262 | * |
| 3263 | 3263 | * @param string $text Optional. The excerpt. If set to empty, an excerpt is generated. |
| | 3264 | * @param WP_Post $post Optional. A specific post to trim the excerpt of. Otherwise the global post is used. |
| 3264 | 3265 | * @return string The excerpt. |
| 3265 | 3266 | */ |
| 3266 | | function wp_trim_excerpt( $text = '' ) { |
| | 3267 | function wp_trim_excerpt( $text = '', $post = null ) { |
| 3267 | 3268 | $raw_excerpt = $text; |
| 3268 | 3269 | if ( '' == $text ) { |
| 3269 | | $text = get_the_content(''); |
| | 3270 | $text = get_the_content( '', false, $post ); |
| 3270 | 3271 | |
| 3271 | 3272 | $text = strip_shortcodes( $text ); |
| 3272 | 3273 | |
diff --git src/wp-includes/post-template.php src/wp-includes/post-template.php
index be15252..ea57573 100644
|
|
|
function the_content( $more_link_text = null, $strip_teaser = false) { |
| 255 | 255 | * |
| 256 | 256 | * @param string $more_link_text Optional. Content for when there is more text. |
| 257 | 257 | * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. |
| | 258 | * @param WP_Post $post Optional. A specific post to trim the content of. Otherwise the global post is used. |
| 258 | 259 | * @return string |
| 259 | 260 | */ |
| 260 | | function get_the_content( $more_link_text = null, $strip_teaser = false ) { |
| | 261 | function get_the_content( $more_link_text = null, $strip_teaser = false, $post = null ) { |
| 261 | 262 | global $page, $more, $preview, $pages, $multipage; |
| 262 | 263 | |
| 263 | | $post = get_post(); |
| | 264 | if ( $post ) { |
| | 265 | $content = $post->post_content; |
| | 266 | } |
| | 267 | |
| | 268 | $post = get_post( $post ); |
| 264 | 269 | |
| 265 | 270 | if ( null === $more_link_text ) { |
| 266 | 271 | $more_link_text = sprintf( |
| … |
… |
function get_the_content( $more_link_text = null, $strip_teaser = false ) { |
| 284 | 289 | if ( $page > count( $pages ) ) // if the requested page doesn't exist |
| 285 | 290 | $page = count( $pages ); // give them the highest numbered page that DOES exist |
| 286 | 291 | |
| 287 | | $content = $pages[$page - 1]; |
| | 292 | // Use the global post if a specific one wasn't passed |
| | 293 | if ( empty( $content ) ) { |
| | 294 | $content = $pages[ $page - 1 ]; |
| | 295 | } |
| | 296 | |
| 288 | 297 | if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) { |
| 289 | 298 | $content = explode( $matches[0], $content, 2 ); |
| 290 | 299 | if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) ) |