Disable organizer choice

Home Forums Calendar Products Community Events Disable organizer choice

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1023141
    Jacob
    Participant

    Hello,

    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,
    Jacob

    #1023187
    Uroลก
    Participant

    +1

    I would also need this feature.

    #1023418
    Barry
    Member

    Hi 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 ๐Ÿ™‚

    #1023449
    Jacob
    Participant

    Hello 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
    Jacob

    #1023485
    Barry
    Member

    Hi 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 ๐Ÿ™‚

    #1023508
    Jacob
    Participant

    Hey 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
    Jacob

    #1023713
    Barry
    Member

    Hi 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 ๐Ÿ™‚

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Disable organizer choice’ is closed to new replies.