Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Block: When adding an existing image within a post, explore "attaching" the image to the post if it isn't already attached #66663

Open
andrewserong opened this issue Nov 1, 2024 · 3 comments
Labels
[Block] Image Affects the Image Block [Type] Enhancement A suggestion for improvement.

Comments

@andrewserong
Copy link
Contributor

andrewserong commented Nov 1, 2024

What problem does this address?

Follows #12753

This issue was raised as part of a much earlier issue (#12753) in this comment: #12753 (comment)

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:

Image

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:

Image

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?

@Marc-pi
Copy link

Marc-pi commented Nov 5, 2024

yep, i stumbled upon this case this week on a customer website, deleting some media flagged as unattached, but were not ;-)

@Mamaduka
Copy link
Member

Somewhat related to the Media Library behavior - #17658.

@ellatrix
Copy link
Member

Imo the whole concept of media attachment should be rethought. Images can be attached to multiple posts, it would be cool to surface all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants