-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Milestone
Description
When saving after having selected a Featured Image, the following error appears in a black box at the bottom:
There has been a critical error on this website. Learn more about troubleshooting WordPress.
Root cause
The REST save endpoint (press_this_rest_save_post) calls side_load_images(), which internally uses media_sideload_image() from wp-admin/includes/media.php. REST API requests do not load wp-admin/includes/ files by default, so this call results in a PHP fatal error: "Call to undefined function media_sideload_image()".
The error surfaces when the post content contains <img> tags with external URLs (e.g. scraped images inserted via the media panel). The sideload endpoint already includes these admin files, but the save endpoint was missing them.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels