Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

fix: pass the missing $post param to the get_the_excerpt filter #1082

Merged
merged 1 commit into from
Sep 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions class-instant-articles-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ public function get_the_subtitle() {
* @return string The excerpt.
*/
public function get_the_excerpt() {

$post = get_post( $this->get_the_id() );

// This should ideally not happen, but it may do so if someone tampers with the query.
Expand All @@ -201,12 +200,14 @@ public function get_the_excerpt() {

/**
* Apply the default WP Filters for the post excerpt.
* https://developer.wordpress.org/reference/hooks/get_the_excerpt/
*
* @since 0.1
*
* @param string $post_excerpt The post excerpt.
* @param WP_Post $post The post object.
*/
$excerpt = apply_filters( 'get_the_excerpt', $post->post_excerpt );
$excerpt = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );

/**
* Filter the post excerpt for instant articles.
Expand Down