Worth noting here that some work would need to be done to ensure Gutenberg added images are properly seen as attached.
Right now, you can have an image in a Gutenberg post or page but the status in WP Admin > Media will still show unattached.
In Gutenberg, if we upload an image to a particular post, then the uploaded image will be "attached" to that post. I.e. if you go to the media library, you can see that it's attached to the post:
However, if we simply select an image from the media library and add it to a post or page, it does not "attach" it to the post.
To verify, add some images to a site via the media library. Then, go to create a post or page. Add the image to the post or page and publish. Then, go to the media library, and the image will still say Unattached under the Uploaded to column:
What is your proposed solution?
When a user adds an image from the media library to a post or page, if the image is not already attached to any post (is unattached), then attach the image to the post.
That's the proposal here! Does this sound good, or are there any potential gotchas, concerns, issues that could arise by introducing this?
What problem does this address?
Follows #12753
This issue was raised as part of a much earlier issue (#12753) in this comment: https://github.com/WordPress/gutenberg/issues/12753#issuecomment-556149071
In Gutenberg, if we upload an image to a particular post, then the uploaded image will be "attached" to that post. I.e. if you go to the media library, you can see that it's attached to the post:
However, if we simply select an image from the media library and add it to a post or page, it does not "attach" it to the post.
To verify, add some images to a site via the media library. Then, go to create a post or page. Add the image to the post or page and publish. Then, go to the media library, and the image will still say
Unattached
under theUploaded to
column:What is your proposed solution?
When a user adds an image from the media library to a post or page, if the image is not already attached to any post (is unattached), then attach the image to the post.
That's the proposal here! Does this sound good, or are there any potential gotchas, concerns, issues that could arise by introducing this?