Make Venues a Custom Post Type

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18661

    My site includes an extensive calendar of events sponsored / presented by local businesses. The local businesses are stored in WP as a custom post type. As EOP works now, I have to re-enter the local business data as EOP venues. Would be great if I could just use my custom post type as the EOP venues.

    Howard Jacobson
    #18674

    Unfortunately this is unlikely to happen. The decision to use a taxonomy rather than a post type was taken very early on, and for the reasons given below. Changing that now and maintaining backwards compatibility would be somewhere between very difficult and impossible.

    There are several reasons why a taxonomy was used over a post type. Firstly taxonomies are intended to group post items – so it’s a natural choice when wishing to group events (i.e. events at this venue). This is actually an over-arching reason which has several facets to it:

    • Queries relating to events at venues builds upon (rather than alongside) WordPress’ API – which means less code is required.
    • It’s also more efficient than using post meta to store a reference to a venue (although if I were to use post types for venues, I’d using a table similar to posts2posts).
    • It ‘fits’ naturally with WordPress’ existing template hierarchy: the main query for a venue page is in one for events rather than for a venue, on which you do a second query to fetch events at that venue.
    • A ‘post type UI’ for venues seemed pretty poor

    There are reasons why a post type would have have been better. Presently taxonomies in WordPress aren’t much of an ‘object’ in their own right. They have a description, and that is all. No custom fields (yet…), and a minimal admin page. Because of this the admin page has to build in parallel rather than on top of that, and because of this some plug-ins that you might like to use for venues probably don’t work.

    The decision to go with the former was that a better underlying architecture would be better in the long run than UX compatibility with other plug-ins. Also making taxonomy terms more like objects in their own right is on the roadmap for WordPress core.

    I don’t know the details of your use case to make any solid recommendations but you might consider:

    • Using just the venue, and not the post type
    • Using the post type and post2post plug-in to connect them to events, and ignoring venues
    • Automating a link between venues and businesses.
    • Continue as you are 😉

    Each have their own advantages / disadvantages, which will depend on what specifically you’re trying to do, and what your requirements.

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.