Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Abz

    (@abzlevelup)

    Hi @mcho, that’s weird. I wonder what happened to this ticket here. Appreciate you bringing this to our attention.

    Could you provide me with more information about what you’re trying to accomplish here? I would like to check if there are any workarounds and point you in the right direction.

    Moreover, let me ask the team about this and get back to you as soon as I hear from them. Seem like this is a good question for our devs.

    Have a great week ahead.

    Best,
    Abz

    Thread Starter mcho

    (@mcho)

    Hi, Abz, thanks for your reply. What I am trying to accomplish is the following:

    1. to be able to choose a past event in the ACF relationship field, which I have accomplished using this code: https://gist.github.com/asadowski10/369b1b60e9280e9b386043d82623f5e0 There, he seems to be removing pre_get_posts from the the Tribe__Events__Query class to stop The Events Calendar from filtering out the past events.

    2. to be able to go to the edit post screen and have the past event selected in the relationship field. I have not accomplished this part of the problem. So right now, I can select a past event and save the post, but when I go back to edit the post, the relationship field shows nothing, and I will have to choose the same event again if I want to have that data persist.

    My question in this ticket has to do with 2 above. Is there a class The Events Calendar uses to display the events chosen in the relationship field to the edit post screen, and, if so, how can I turn off filtering there so that I can see the past event already selected for this field?

    Let me know if this is not clear.

    Thanks!

    Plugin Support Abz

    (@abzlevelup)

    Hi @mcho, I appreciate you providing me with more details here. I would need to ask our team about what you’re trying to accomplish here as it seems it requires more technical attention.

    I’d reach out to our devs and get back to you as soon as I know more about this.

    No worries, please hang tight for now.
    Have a great day.

    Best,
    Abz

    Plugin Support Abz

    (@abzlevelup)

    Hi @mcho, apologies for the delay here. I’m following up with the team in regard to what you’re trying to accomplish here. I haven’t heard back from them. I’d keep you posted here.

    Appreciate your patience here.

    Best,
    Abz

    Thread Starter mcho

    (@mcho)

    I found the answer myself, and the gist is updated above. Thanks! I’m closing this ticket.

    @mcho,
    I have the same issue and the code here didn’t work anymore.
    Do you have an updated code ?
    Thanks in advance.
    Best.

    My code works with current events.

    $myfield= get_field('myfield');
    $myfield_ID = $myfield->ID;
    echo $myfield_ID;
    

    It returns event ID with current events but with past events it returns me nothing, none ID…
    With ID, I can display event linked by acf post object title, thumbnail, etc… but without, impossible to display anything from a past event.
    If I replace manually the ID variable (ex: $myfield_ID = ‘4055’;) it displays the past event.
    I dont understand why it doesn’t returns me the ID, even if it’s a past event.
    Any help appreciated.
    Best.

    • This reply was modified 2 years, 3 months ago by trint.
    • This reply was modified 2 years, 3 months ago by trint.
    • This reply was modified 2 years, 3 months ago by trint.
    • This reply was modified 2 years, 3 months ago by trint.
    • This reply was modified 2 years, 3 months ago by trint.
    • This reply was modified 2 years, 3 months ago by trint.

    Hi @abzlevelup,
    any thoughts on this ?
    Thanks in advance.
    Best

    Hi everybody,
    I found the solution.
    Instead of searching like me for hours I share it if someone has this issue too.
    You just have to choose post ID instead of post object and it works like a charm.
    Best.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘ACF relationship field for past events’ is closed to new replies.