Home › Forums › Calendar Products › Community Events › Disable organizer choice
- This topic has 6 replies, 3 voices, and was last updated 10 years, 5 months ago by
Barry.
-
AuthorPosts
-
November 9, 2015 at 1:53 am #1023141
Jacob
ParticipantHello,
I want to disable the choice of the event organizer on the frontend form and make the logged in user the default event organizer.
How can I achieve this?
Best,
JacobNovember 9, 2015 at 6:18 am #1023187Uroลก
Participant+1
I would also need this feature.
November 9, 2015 at 12:57 pm #1023418Barry
MemberHi guys,
I’d definitely recommend logging a feature request over on our UserVoice page if you’d like to see this rolled into a future release – that way others can upvote the idea which is really useful when the time comes for us to prioritize requests.
As an interim step, you can disable the organizer fields simply by overriding the community/edit-organizer.php template. The general process for creating template overrides is covered here, but basically all you need to do is create a new, empty file within your theme located as follows:
wp-content/themes/YOUR_THEME/tribe-events/community/edit-organizer.php
Again, don’t put anything in this file, just leave it empty.
To make the current logged in user the organizer automatically is going to involve a little more work. The general process might look something like this:
- Test to see if there is an existing organizer post for this user whenever they submit an event (you might listen in using the tribe_community_event_created hook)
- If there isn’t then create a new organizer – you may wish to use post or user meta data to “link” it to the appropriate user
- If there is already an organizer record for this user, or one has been created, go ahead and link it up to the event
That’s a very high level overview and the fact is this is a little too involved for us to detail the entire solution here on the forums, but it is certainly possible and hopefully gives you a starting point you can work from ๐
November 9, 2015 at 1:48 pm #1023449Jacob
ParticipantHello Nico!
Thank you for your engagement!
Regarding the second issue, my install has no default organizer yet. I haven’t understood this sentence:
you may wish to use post or user meta data to “link” it to the appropriate user
It seems like my question was how to link this event post to the logged in user and your answer sounds to me like ‘you may wish to link it to the logged in user’ ๐ I have googled this briefly but couldnt get far with this explaination. Can you give me one more hint?
Yours
JacobNovember 9, 2015 at 3:01 pm #1023485Barry
MemberHi Jacob,
In The Events Calendar, organizers are a type of post not unlike events or blog posts – so the easiest approach to your problem is to create an organizer post for each logged in user that submits an event.
For reasons of efficiency you would probably wish to create an easy way of finding whichever organizer post matches the currently logged in user. Thankfully, WordPress allows you to store arbitrary pieces of meta data for each post and user – that means you could add an _organizer_id field to the user’s meta data, or else a _user_id field to the organizer post meta data, or if you really wanted you could do both.
This would effectively link the two together, letting you easily match user and organizer, etc.
I hope that makes a little more sense, but really it was nothing more than a suggestion and you are of course free to implement this however you want ๐
November 9, 2015 at 4:08 pm #1023508Jacob
ParticipantHey Barry,
All right, thanks a lot for that way to realize it.
I still can’t see how, even after that match being implemented, The Events Calendar knows that the post author becomes the organizer of the event. Does this somehow happen automatically after the modification you have suggested or is there any additional step I must add?
Yours
JacobNovember 10, 2015 at 7:14 am #1023713Barry
MemberHi Jacob,
You’re right – it wouldn’t happen automatically.
This is something you’d need to handle as part of your customization. Note that the hook I referred to earlier on in the discussion – tribe_community_event_created – could be a part of how you tackle this (when that action fires, you know that a new community event has just been submitted).
I’m sorry we can’t go into further detail on this one. While it is certainly achievable, technical customizations of this nature are tasks that you (or a developer working on your behalf) really need to drive forward.
With that in mind I don’t think we can go any further here and I will close this topic – but I do wish you luck with this task ๐
-
AuthorPosts
- The topic ‘Disable organizer choice’ is closed to new replies.
