Create venue in two sites at the same time

Home Forums Calendar Products Events Calendar PRO Create venue in two sites at the same time

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #882009
    corre
    Participant

    I have a WP multisite installation and when a venture is being created, I need to programmatically create the same venture post on other sites in the network as well.

    Example:

    function sync_ventures_between_sites($post_id) {
    // get the tribe_venture post using the post id
    // iterate through all sites in the network
    // insert post using the supplied post data
    }
    add_action(‘tribe_venture_published’, ‘sync_ventures_between_sites’);

    All I really need is the action hook to where a venture post has just been created.

    #882069
    corre
    Participant

    Nm. Forgot something I knew already. Can be achieved with hook save_post_tribe_venue and function tribe_create_venue() using iteration between all blogs with switch_to_blog() and restore_current_blog().
    Have fun 🙂

    #882366
    Brian
    Member

    I am glad to see you were able to figure it out.

    Since the issue is resolved I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Create venue in two sites at the same time’ is closed to new replies.