WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#7764 closed enhancement (invalid)

Making the attachments independent of the posts they belong too

Reported by: ShaneF Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Make attachment system independent so attachments can be used on any page/post.

Change History (10)

#1 @Viper007Bond
11 years ago

  • Component changed from Administration to General
  • Keywords needs-patch added
  • Milestone changed from 2.7 to 2.9

(2.9 for stuff without patches.)

You might want to expand upon your ticket explaining why you want this feature and what purpose it would serve.

And there's currently solutions for inserting attachments from other posts/pages into a post/page:

For single attachments: go to the attachment's parent, insert it into the content, then cut/paste the resulting HTML into another post/page. Dirty, but it works.

For galleries: use the "id" parameter. I have the same gallery in multiple posts/pages, works just fine. Details: http://codex.wordpress.org/Using_the_gallery_shortcode

#2 @Otto42
11 years ago

Attachments already can be used on any page/post. Just click the Media Library tab when in the Insert Media dialogue to use any attachment you've got, on any post.

-1 to this because not having attachments attached to posts would make the gallery functionality way more complex and hard to use.

#3 @jacobsantos
11 years ago

I don't think judgment should be passed until an implementation is made. After hearing the discussion on IRC about it, I think we should give it a chance and if it sucks, it sucks. I think from the previous work, that it could end up being a great boon to WordPress or not. We won't know until there is a patch.

#4 @Otto42
11 years ago

I'm inclined to disagree on that one. I can judge an idea without an implementation, especially when I know what the implementation will entail, mostly.

See, my main concern about this sort of thing is that any implementation will, by necessity, wholly break the idea of attachment posts if they're in a separate table. My image.php and audio.php and video.php files in my template will be useless. Things like that. There's a hell of a lot of backward compatibility required, and so I'm not at all certain that the idea is worth considering.

Sure, if I was designing a system from scratch, attachments would have a separate table. But given everything that can be done with them in posts now, and all the plugin potential (and several damn neat plugins that exist and rely on this sort of thing), then I'm inclined to have extreme doubts about this idea from the very beginning.

I think a 3.0 milestone would be far more appropriate for such a radical change to the system. :)

#5 follow-up: @jacobsantos
11 years ago

I think the conversation was that the list of posts that the attachments were attached to would be a metadata option. The posts table is fine and yeah I agree, if it requires an extra table, then it will be a, "No go."

I'll allow for the reporter to release more details, however.

#6 in reply to: ↑ 5 @Otto42
11 years ago

Replying to jacobsantos:

I think the conversation was that the list of posts that the attachments were attached to would be a metadata option.

I don't quite see what the benefit would be then, in that case. Attachments could be in more than one gallery, I suppose, but the interface would be a bit strange.

And again, you can already insert any attachment into any page or post, right now, very easily. There's a whole tab just for that. You don't need to attach the attachment to the page/post first.

#7 follow-up: @ShaneF
11 years ago

Every time I dive into the posts table, and I see attachments in the "posts" table it really confuses me. Same with "pages" and "revisions" but that's another story. This "ticket" is not in protest of attachments (images, video, audio) using postmeta table to hold data information.

Now certain columns can be brought over to a new "attachment" table, but if people are worried about [gallery] being broken because it wouldn't link to the post. My revised idea of ticket #7607 using part of this idea, postmeta would hold attachment index "_wp_attachments" with the post_id linking to the page/post would keep video.php, audio.php, and image.php working correctly and able to create and index of "galleries" for easy inserting on any page (maybe add a "type" tag to the [gallery] shortcode btw..)

With attachments not attached directly to posts, attachments in their singular mode could be still searched with tags, up-load date, filename, etc. I still think this can be pulled off for 2.7 since the changes would just be table changes and upgrade script.

This is my new dedicated code if given the go ahead.

#8 @DD32
11 years ago

my comment on #7607 really relates to this ticket too, Heres a quick paraphrased quote from it:

I dont see the extra table has being any benefit here, It reminds me of the post2cat, and link2cat tables of past, it feels like backwards step

I feel that using a taxonomy system for galleries and whatnot might be a better option

(Go read the actual comment in full to get all the reasoning)

#9 in reply to: ↑ 7 @Otto42
11 years ago

Replying to ShaneF:

My revised idea of ticket #7607 using part of this idea, postmeta would hold attachment index "_wp_attachments" with the post_id linking to the page/post would keep video.php, audio.php, and image.php working correctly and able to create and index of "galleries" for easy inserting on any page (maybe add a "type" tag to the [gallery] shortcode btw..)

If that is the case, then -1000 to this idea. I don't want some kind of weird code for creating "pretend" posts out of my attachments. Attachments are posts. They're not just "stuck" into that table... they are actual posts, with descriptions and titles and everything else.

Going to all the trouble to make them not posts any more and then some other code to make them look like posts later is somewhat of a strange thing to do, IMO.

With attachments not attached directly to posts, attachments in their singular mode could be still searched with tags, up-load date, filename, etc. I still think this can be pulled off for 2.7 since the changes would just be table changes and upgrade script.

Attachments can already be searched for like that. You don't need to do all this to do what you're talking about. Where is the actual benefit from what you're proposing here? What can you do with your idea that you cannot do right now?

#10 @ShaneF
11 years ago

  • Keywords needs-patch removed
  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 2.7 deleted

After full discussion with everyone, looks like this is going to be removed as I have solved the problem that #7607 had.

Note: See TracTickets for help on using tickets.