diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
index c1f6f67..27f87d3 100644
|
|
add_filter( 'the_excerpt', 'convert_smilies' ); |
155 | 155 | add_filter( 'the_excerpt', 'convert_chars' ); |
156 | 156 | add_filter( 'the_excerpt', 'wpautop' ); |
157 | 157 | add_filter( 'the_excerpt', 'shortcode_unautop' ); |
158 | | add_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); |
| 158 | add_filter( 'get_the_excerpt', 'wp_trim_excerpt', 10, 2 ); |
159 | 159 | |
160 | 160 | add_filter( 'the_post_thumbnail_caption', 'wptexturize' ); |
161 | 161 | add_filter( 'the_post_thumbnail_caption', 'convert_smilies' ); |
diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
index f9795fd..0c00f25 100644
|
|
function human_time_diff( $from, $to = '' ) { |
3558 | 3558 | * The ' […]' string can be modified by plugins/themes using the {@see 'excerpt_more'} filter |
3559 | 3559 | * |
3560 | 3560 | * @since 1.5.0 |
| 3561 | * @since 5.0.0 Add $post argument |
3561 | 3562 | * |
3562 | 3563 | * @param string $text Optional. The excerpt. If set to empty, an excerpt is generated. |
| 3564 | * @param WP_Post $post Optional. A WP_Post object of the excerpt queried. |
3563 | 3565 | * @return string The excerpt. |
3564 | 3566 | */ |
3565 | | function wp_trim_excerpt( $text = '' ) { |
| 3567 | function wp_trim_excerpt( $text = '', $post = null ) { |
3566 | 3568 | $raw_excerpt = $text; |
3567 | 3569 | if ( '' == $text ) { |
3568 | | $text = get_the_content( '' ); |
| 3570 | if ( ! $post ) { |
| 3571 | $text = get_the_content(''); |
| 3572 | } else if ( is_a( $post, 'WP_Post' ) ) { |
| 3573 | $text = $post->post_content; |
| 3574 | } |
3569 | 3575 | |
3570 | 3576 | $text = strip_shortcodes( $text ); |
3571 | 3577 | |