Home › Forums › Calendar Products › Community Events › Adding organizer to add new event
- This topic has 8 replies, 2 voices, and was last updated 9 years, 11 months ago by
Brook.
-
AuthorPosts
-
May 11, 2016 at 12:34 pm #1113382
indycourses
ParticipantHi,
The use case for creating a community event requires that all the other organizers be hidden from the user on the ‘add new event’ form. I have streamlined things by creating a form that creates the organizer, and I have stored the organizer’s id as user_meta.
I have gotten so far as displaying the ID/name of the organizer automatically on the ‘add an event’ form but wonder how to actually save the organizer to the event.
Is there a function I can call/hook/filter to accomplish this?
Thanks
May 11, 2016 at 10:06 pm #1113600Brook
ParticipantHowdy Roxanne!
From what I understand you are trying to set things up so that when a user registers on your website using your form they create an organizer, and that organizer is saved. You already have this working, awesome! The problem is that when a user goes to submit an event using Community Events they see all of the other organizers available for selection, not just themselves.
If I understand correct then this should be pretty easy. You say you already ID of the organizer showing on the Add Event page. That must mean you have create a theme override (Ala the Themer’s Guide ). If I were you I would use that override to hide the Organizer fields completely. You can do this by overriding: public_html/wp-content/plugins/the-events-calendar-community-events/src/views/community/edit-event.php and on line 64 remove the organizer module. Now replace it with a <input type=”hidden” /> and set the value of that hidden field to your organizer ID. Something like this should work:
<input type="hidden" name="organizer[OrganizerID][]" value="{OUTPUT YOUR ORGANIZER ID HERE}">Assuming you have the actual organizer ID from WordPress (which is a number) then output that in the value attribute. This hidden field will replace the visible one, and when a user submits the form it will pass this fields data in place of the old visible one. Does that make sense? Does that work?
Cheers!
– Brook
May 13, 2016 at 12:21 pm #1114414indycourses
ParticipantHi Brook,
Thanks so much, that saved the day.
Follow up question; since I am using gravity forms to create/update the instructor is there a similar way to save an email address to the ‘organizer[Email]’ field? That really seems to be the last piece of the puzzle.
May 13, 2016 at 5:20 pm #1114504Brook
ParticipantHowdy again,
I am so happy that helped!
since I am using gravity forms to create/update the instructor is there a similar way to save an email address to the ‘organizer[Email]’ field? That really seems to be the last piece of the puzzle.
There definitely has to be a way. But I am not familiar enough with Gravity forms to know what the difficulty is. 🙁 If you can clarify on how you added the field and why the email is being especially difficult I might be able to help.
- Brook
May 16, 2016 at 6:01 am #1114846indycourses
ParticipantHi Brook,
Gravity Forms just has a standard email field, and I am not able to change the ‘name’ or ‘value’ attributes to tie it to the ‘Organizer Email’ meta field. I am using a plugin for Gravity Forms that creates the organizer post, I’m just having trouble figuring out how to save the email ass the ‘organizer email.’
Thanks for all your help
May 16, 2016 at 6:38 am #1114866indycourses
ParticipantA follow up this this last question. I did find the ‘edit an organizer’ page at this URL ‘courses/community/edit/organizer/5080/’
Is there a front-end version of ‘create an organizer’ that I could use. That would bypass the need for gravity forms, and allow me to save the organizer email properly.
Thanks again
May 16, 2016 at 9:16 am #1114981Brook
ParticipantHello again,
We do not really have a submit an organizer page aside from the section included in the Add Events form.
I think I understand now how you are submitting the Organizer. I am reasonably certain Gravity Forms allows you to submit “Post Meta” along with the primary title and description. Assuming it does, then you will need to set it up to submit with the “meta key”
_OrganizerEmail
Detailed info on our Meta keys can be found here.
I wish i could be more specific but it’s been so long since I’ve used gravity form, I don’t even have a license anymore. You might ask them how to do this if you need detailed help. “Post meta” and “meta keys” are generic wordpress terms, so if you ask “how can I submit a value to a specific post meta key in my form?” they will be able to tell you. The key is _OrganizerEmail so just follow the steps for that key.
Please let me know if there is anything else. Cheers!
– Brook
May 24, 2016 at 10:17 am #1118310indycourses
ParticipantThank you, I sorted it all out.
May 24, 2016 at 3:45 pm #1118468Brook
ParticipantExcellent news! Thanks for getting back Roxanne.
- Brook
-
AuthorPosts
- The topic ‘Adding organizer to add new event’ is closed to new replies.
