• Resolved jlgallego99

    (@jlgallego99)


    Hello,

    I am currently using the save_post_tribe_events hook when creating an event in the wordpress page to retrieve it and do something with it. I want to retrieve that event with the ORM like this:

    add_action('save_post_tribe_events', 'get_event');
    function get_event($event_id) {
      $new_event = tribe_events()->by('id', $event_id)->first();
    }

    The problem is that returns null and I think that is because the event hasn’t been stored yet on the db when that hook fires. I could use the tribe_get_event() function, but that doesn’t give me all the info the ORM gives me, like the venue object or the organizer object

    What can I do?

    Thank you for your time

    • This topic was modified 1 year, 2 months ago by jlgallego99.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Darian

    (@d0153)

    Hi @jlgallego99

    Thanks for reaching out. Let me help you with this one.

    Are you creating your events manually from the WP Admin dashboard > Events > Add New? Or are you adding the event from a third-party plugin or from a customization?

    Moreover, please provide the version of The Events Calendar and PHP you’re currently using. I want to check it further on my side.

    Looking forward to your reply.

    Plugin Support Darian

    (@d0153)

    Hi there,

    It seems like it has been some time since we received a response from you, therefore, I will consider this matter as resolved. If you require any further assistance, please do not hesitate to start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Retrieve event with ORM after creating it?’ is closed to new replies.