[wp-hackers] Idea: Widgets as custom post types
justin.shreve at gmail.com
Tue Mar 2 21:04:32 UTC 2010
First with the introduction of the whole custom post types we should be
thinking of 'content types' rather than 'post types'. (this is stated within
http://core.trac.wordpress.org/ticket/9674) the table name of wp_posts and
the notion of posts I believe is for backwards compat.
This is the point:
The whole point of custom posts types was to reduce duplicate functionality
and code for certain things (mentioned within the trac ticket).
We have duplicate/similar code to have a links manager that could easily be
done (and more) if it was stored within a new post types. It makes it easier
to maintain and gives us "things for free".
I'm not saving to stick every bit of data in one table, but the things that
can save us work and makes sense when talking about 'content types' we
On Tue, Mar 2, 2010 at 3:53 PM, Otto <otto at ottodestruct.com> wrote:
> On Tue, Mar 2, 2010 at 2:43 PM, Michael Pretty <mpretty at voceconnect.com>
> > Heck, lets go ahead and put the terms tables into the posts table. No
> reason we can't turn the entire database into a nodal system. :)
> > 3 tables:
> > objects
> > objects_to_objects_map
> > object_meta
> > -prettyboymp
> Thank you! This is what I think sometimes too when I see this sort of
> People, turning everything into a subtype of "post" is stupid. Okay,
> sure, for *some* things it makes sense to treat them in a generic
> object sense. Pages, posts, attachments, these I get (mainly because
> attachments get a special post-like page out of it).
> Changing Links into Posts does not make sense to me. Changing Widgets
> does not make sense to me. These are fundamentally different things,
> used in different ways. They should be designed to be the most
> efficient for their use case, not made generic just for the sake of
> making them generic.
> I think we should leave "posts" to things that are some form of
> "post", or which can be displayed as such. Everything the "posts"
> table currently holds things that can be represented as a "post" in
> some fashion. Even Matt's custom "person" post-type trick has a decent
> representation as a post page, by showing all the image attachments
> with that person.
> If Links needs to be expanded, then I'd support that. Why can't links
> be tagged? It wouldn't be hard to add "link-tag" to the taxonomies.
> Much better solution than shifting a link to a post. How do you
> display a link as a post? Best I can think of would be a redirect. ;)
> Widgets should be made more generic, yes. But most likely they should
> be given their *own* table. Why? Because it's difficult to imagine a
> solid case for representing a single widget as a whole post page as
> well. Also, widgets don't need tagging or categories. What they need
> is a way to define their contents and parameters and code in a sane
> manner, and then to be easily placed and moved around the page. In
> this sense, they can move beyond the sidebar and onto the rest of the
> Lets just think before acting, that's all I'm saying.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers