Viewing 4 replies - 1 through 4 (of 4 total)
  • Yup – WordPress doesn’t support meta fields for taxonomies out of the box (yet, or perhaps ever: https://core.trac.www.ads-software.com/ticket/10142#trac-add-comment

    Currently the plug-in creates its own table to store venue details. However, this has set columns (address, postcode etc). I’m thinking at some point of changing this to a key-value type table (like the meta tables). This would make it possible for the table to be used to store custom meta data for the venue.

    I will also need to add some hooks and filters for adding fields (or maybe metaboxes). Unfortunately WordPress doesn’t handle metaboxes for taxonomies (and certainly not custom pages such as the venue admin page). Of course, this call be included with the plug-in – but it may end up reinventing the wheel, which I’d like to avoid.

    Someone has already asked for adding additional fields to the venue page – would you want the fields to be in the same ‘metabox’ as the map, or in a separate one?

    This is now in development: https://www.harriswebsolutions.co.uk/event-organiser/general-announcements/2012/major-changes-in-1-4/

    The edit-venue page will support meta-boxes and include hooks that fire when the venue (and it’s meta data) is updated. You will be able to hook onto this action and collect your metaboxes data from the form and update/add venue meta data in a similar way to how you would hook into save_post for posts.

    Thread Starter Ian Anderson Gray

    (@baritoneuk)

    Thanks, Stephen, this looks great.

    Sorry I never got back to you- just madly busy.

    I’m only starting to understand WP hooks and meta data, but I am assuming that Events Organiser 1.4 might allow me to add extra fields to venues?

    Yes it will – in the form of adding extra metaboxes (like you might create a metabox for a custom post type). In the custom metabox you can add your extra fields and then hook into the appropriate hook to save that data when the user clicks ‘update’ (documentation will be provided).

    Unlike post types there won’t be, by default, ‘custom fields’ (i.e. where you create a field by supplying a label and value) – but its possible to add arbitrary fields on the fly by creating a metabox that does this. This won’t be in 1.4, but maybe later, so when storing venue meta you should choose keys that start with an underscore.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Event Organiser] custom fields in venue’ is closed to new replies.