use additional fields in community add-on to make event private

Home Forums Calendar Products Community Events use additional fields in community add-on to make event private

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #533904
    Tony Ash
    Participant

    I’m using the community add-on and have it configured to allow anonymous submissions.
    I need to provide a way for my users to submit events and make them either public or private automatically based on their “add an event” form submission. This means I need it to work without having to have a wordpress account to do so, and without having to have an admin moderate events submissions before they go live on the site.
    To do this, I created an additional field with a radio button for users to define if they want their event to be public or private. I’d like to use this info to set the event post itself to private or published.
    What’s the best way to connect these together?

    #534384
    Barry
    Member

    Hi – great question!

    You could listen out for the creation of events (or even for them being updated) by using WordPress’s save_post_{post_type} hook, in this case that would look like:

    save_post_tribe_events

    From there you would need some logic to test and see if the user’s intent was to make it private or not – possibly by inspecting the $_POST superglobal (you may also want to add some other safety checks into the mix) and then update the post status accordingly.

    It’s a bit beyond the scope of support here on the forum to go much further with a customization like this one but hopefully that outlines the basic mechanics – from here we’ll need to leave the rest to you 🙂

    #534552
    Tony Ash
    Participant

    Thanks for the guidance. Do you offer a paid support option to get more specifics ?

    #540437
    Barry
    Member

    I’m afraid we do not, but we’d be happy to provide you with a list of independent developers/freelancers who might be able to assist if you email us at pro (at) tri (dot) be.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘use additional fields in community add-on to make event private’ is closed to new replies.