WordPress.org

Ready to get started?Download WordPress

Forums

Event Organiser
custom fields in venue (5 posts)

  1. baritoneuk
    Member
    Posted 1 year ago #

    I am assuming that a venue is a taxonomy? I wanted to add extra fields, but I've been able to do that using plugins such as Ultimate Taxonomy Manger. Is there a reason for this? Ideally I wanted to add a field for the venue url, phone number etc.

    http://wordpress.org/extend/plugins/event-organiser/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Yup - WordPress doesn't support meta fields for taxonomies out of the box (yet, or perhaps ever: http://core.trac.wordpress.org/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?

  3. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    This is now in development: http://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.

  4. baritoneuk
    Member
    Posted 1 year ago #

    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?

  5. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.