[wp-hackers] Menu schema

C T cegert.on at gmail.com
Sun Mar 21 00:19:03 UTC 2010


This is a very pertinent point being made I feel. A .0 release IS the
time to make major changes to important high level WP design such as
DB schematics.
This issue is similar to the currently debated issue of how widgets
and comments are currently represented in the WP DB.

In terms of the way menus are handled and stored in DB, the current
implementation is far from ideal.
Storing objects such as menu items as posts makes little sense as the
whole basis of posts is that they are data, ie have content. This is
not the main issue however, the issue is the complexity and confusion
this causes. So you can access a menu item with the get_post
function?? No a menu does not need the complex data display and
manipulation functions that actual data (posts) need.

Storing menus as taxonomy also makes little sense. Taxonomy is the
process of naming and classifying things. This has great benefit to
discreet data and in classification, however what benefit does this
give to objects such as menu items? (Are they really 'objects'
anyway?) This really seems like a poorly thought out hack and very
inconsistent with other areas of WP.

For me there are two clear options. Firstly a temporary measure to
treat menus similar to widgets, with one entry in wp_options for menus
and one for menu_items. Simple.
Second, and and more benefit in the long run with the development of
WP into a fully functional CMS would be to reevaluate the DB schemata
and actually look at the reasons the WP database is limited to so few
tables. Lets not confuse different entities and lump different
entities together.

On Fri, Mar 19, 2010 at 2:30 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
>>
>> If I do write the code to change that, why won't it make it into 3.0?
>
> It'll improve things in the long run.
>
>
> Not necessarily -- it won't make it into 3.0 because the core developers
> have discussed the schema at length and find the current implementation the
> best option. We use more fields in the posts table than you think --
> including post_author, menu_order, post_parent, post_excerpt, post_content
> and post_title. And we store additional data in post meta. Part of this is
> because we allow for menu item names other than the name of the category or
> title of the page. We also allow title attributes, descriptions (for when
> the theme supports it), XFN, custom CSS classes, link target, URL (for a
> custom link), etc. Therefore, we used post types and post metadata for menu
> items.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list