Hi,
Thanks for your info.
I’ve checked in the latest versions of the WordPress core and the Jetpack plugin. Your reasoning makes sense for me.
* https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/post-template.php#L397 – * @since 4.5.0 Introduced the $post parameter.
* https://github.com/Automattic/jetpack/blob/5.8/_inc/lib/class.media-summary.php#L314
Can you please let us know which theme you’re using? We will try to test this issue.
If the theme is a premium (paid) theme, please send us via this contact form:
https://jetpack.com/contact-support/?rel=support
Thanks!
Thread Starter
kmvan
(@kmvan)
Thank you your reply and take a look.
E.g codes (PHP7+):
\add_filter('get_the_excerpt', '\balabala', 10, 2);
function balabala(string $excerpt = '', \WP_Post $post): string
{
return $excerpt . $post->ID;
}
It is an error about the $post param.
So I think the ./_inc/lib/class.media-summary.php L57 add $post param:
$return['excerpt'] = self::get_excerpt( $post->post_content, $post->post_excerpt, $args['max_words'], $args['max_chars'], $post);
And L301 change add $post param:
static function get_excerpt( $post_content, $post_excerpt, $max_words = 16, $max_chars = 256, $post ) {
And L314 add $post param:
$post_excerpt = apply_filters( 'get_the_excerpt', $post_excerpt, $post );
Then I think it is no problem.
Hi,
Thanks for your detailed info.
I confirm that it’s something we’re working on this PR on GitHub.
https://github.com/Automattic/jetpack/issues/8420
I am sorry that I would find out this PR in the first reply.
Hope that it can be dealt with as soon as possible