-
Notifications
You must be signed in to change notification settings - Fork 650
Description
Hi.
I kindly ask you to consider this.
■Problem Description
When media (e.g., an image) is first uploaded directly within a post's editing screen, that post becomes the media item's parent. If this parent post is then set to a private status (or deleted), the media item itself also becomes inaccessible via the media REST API endpoint.
https://example.com/wp-json/wp/v2/media
This behavior was observed and verified through testing.
This creates an unexpected dependency where media accessibility through the API is tied to the privacy status of its initial parent post, even if that media is later used in other public posts. This can lead to broken media links or inaccessible assets when consuming media via the API.
■Expected Behavior
Media uploaded to WordPress should remain accessible via the /media REST API endpoint regardless of the privacy status of the post it was initially uploaded through. Its accessibility should ideally be determined by its own status or its usage in publicly accessible content, rather than being strictly tied to a single "parent" post's private status if that parent is merely the point of initial upload.
■Proposed Solution / Workaround
It is suggested that this behavior be documented on pages like https://developer.wordpress.org/rest-api/reference/media/ as a note of caution regarding the accessibility of media items, especially those initially uploaded within a post.