Home › Forums › Calendar Products › Events Calendar PRO › Is it possible to add additional fields to Venues?
- This topic has 13 replies, 6 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
April 17, 2012 at 2:57 am #17979Martijn MeyerParticipant
We need two extra fields for Venues: mail and website. Is it possible to add them? You can add additional fields, but they are added to Events.
April 17, 2012 at 9:06 am #17988RobMemberHi Martijn. Thanks for reaching out here; this is an interesting request. I don’t know what it’d take to accomplish (or if it’s even possible) but I’ve asked our dev Jonah to take a look and see if he can point you in the right direction.
Jonah is out until tomorrow, but should be back and taking a look at that point. Stay tuned!
April 17, 2012 at 9:26 am #17993HenryMemberYou can make the venue post type support WordPress custom fields by modifying the-events-calendar-class.php file.
Look for this code protected $postVenueTypeArgs = array( (it is around line 32)
You need to add support for custom fields. See my code here that works nicely for me.
http://pastie.org/3805194Be aware if you upgrade The Events Calendar you will loose these changes. Jonah might know of a way to do this without hacking the core.
April 17, 2012 at 7:38 pm #18022JonahParticipantHey Martijn,
Luckily you can get Venue’s to support custom fields without hacking the core. Just use the native add_post_type_support() function: http://codex.wordpress.org/Function_Reference/add_post_type_support
add_post_type_support( 'tribe_venue', array('title', 'editor', 'custom-fields') );
Honestly I wouldn’t use WordPress’ custom fields though. I would suggest looking at the much more powerful and easier to use: http://www.advancedcustomfields.com/
I hope that helps!
April 18, 2012 at 1:35 am #18027Martijn MeyerParticipantThanks for the answers. FYI I want to add them in the Venue Information block. Reason for this is I am building a site for a customer. This site will have events (with their own ticket url), venues (with their own url) and organisers (with also their own url).
Customer will use organisers which organize events at multiple venues. Or use events (restaurant deal for example) at venues (a restaurant) which doesn’t have a clear organiser.
To keep input as easy as possible url and e-mail should be added to the Venue Information block, since other people will add information. Fields on different places is not user friendly.
April 18, 2012 at 4:20 am #18029HenryMember@Martijn,
I am pretty sure that would mean hacking the plugin core. If you’re going to hand over to a client then i’d suggest leaving the core untouched as if your client decides to update the plugin at a future date, all of your changes will be lost.
April 18, 2012 at 4:56 am #18030Martijn MeyerParticipantTherefore I ask it overhere. Maybe it is a nice addition for a future version. Since events, venues and organizers can all have their own website.
April 18, 2012 at 5:06 am #18031HenryMember@Martijn
I agree, great suggestion. You could go one step more and instead of having fixed custom fields in the venue/event/organiser information block, you could have variable fields where the user can specify their own name/value pair (in the same way as WP custom fields work now)
April 18, 2012 at 9:51 am #18037JonahParticipant@Martijn, yeah unfortunately that’s not currently possible to have fields in the Venue Information block. You can request that as a feature here though: https://theeventscalendar.com/support/forums/topic/events-calendar-pro-feature-requests/
May 2, 2012 at 2:17 pm #18576Amy KiserParticipant@Jonah
Where would I add the add_post_type_support code? Would it go in a functions.php file for the theme? Thanks for entertaining my naive question.
– DavidMay 2, 2012 at 2:41 pm #18580HenryMemberJonah’s code goes in your theme’s functions.php file. As pointed out in the WP function reference, typically add_post_type_support() should be attached to the ‘init’ action hook.
Example:
http://pastebin.com/jMhkWhmzMay 2, 2012 at 2:47 pm #18581May 2, 2012 at 4:12 pm #18586JonahParticipantThanks Henry and David, please let us know if there’s anything else you need with this.
July 7, 2015 at 6:19 am #976709Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Is it possible to add additional fields to Venues?’ is closed to new replies.