Skip to content

Commit

Permalink
Only add filter before rendering the excerpt to avoid affecting other…
Browse files Browse the repository at this point in the history
… parts of the codebase where get_the_excerpt() might be used.
  • Loading branch information
anton-vlasenko authored and Anton Vlasenko committed Oct 16, 2023
1 parent cc02692 commit 79a0cda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-excerpt/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
add_filter( 'excerpt_length', $excerpt_length_filter_callback, PHP_INT_MAX );

// Get the excerpt content for the current block's post.
$excerpt = get_the_excerpt( $block->context['postId'] );
$excerpt = get_the_excerpt( $block->context['postId'] );

/**
* Remove the overridden excerpt length filter to avoid affecting other parts
Expand Down

0 comments on commit 79a0cda

Please sign in to comment.