-
Notifications
You must be signed in to change notification settings - Fork 4.8k
get_the_excerpt is taking PHP out of memory in a block rendering #5572
Copy link
Copy link
Closed
Labels
[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Milestone
Description
Issue Overview
I'm rendering a block in PHP that display another post preview card so I simply use (in the render_callabck) :
$id = $attributes['postID'];
$post = get_post( $id );
$excerpt = get_the_excerpt( $id );
I get a Fatal error: Allowed memory size of... from PHP from get_the_excerpt()
It look like it's too much for WP to parse the gutenberg saved markup
The targeted post only has a few paragraphs and a read more tag.
The issue does not happen if I set manually an excerpt in the inspector.
This memory issue does not occur outside a block rendered in PHP
Steps to Reproduce
- create a post with gutenberg
- add a read more block but no excerpt on inspector
- create a block rendering in PHP
- on the render hook, try to get_post and get_the_excerpt
Expected Behavior
display everything
Current Behavior
Allowed memory size of
Todos
- Tests
- Is it a legit issue?
- find where occurs the memory leak and why
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
