[wp-hackers] Idea: Widgets as custom post types

Otto otto at ottodestruct.com
Tue Mar 2 20:53:00 UTC 2010


On Tue, Mar 2, 2010 at 2:43 PM, Michael Pretty <mpretty at voceconnect.com> wrote:
>
> 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 thing.

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
structure.

Lets just think before acting, that's all I'm saying.

-Otto


More information about the wp-hackers mailing list