Ninja Forms merge tags and Events Calendar Pro
-
I’m working with someone who has a fairly custom setup involving Ninja Forms and The Events Calendar. They are using The Events Calendar to display event data, but people register using Ninja Forms, and now they want to be able to have the “Add to calendar” links appear in confirmation emails.
Merge Tags seem to be the answer, but I can’t seem to get it working. In particular, I’m not sure how I can add this to functions.php to have it create the proper link.
From what I can find, the merge tag would use this code:
add_action( 'ninja_forms_loaded', 'my_register_merge_tags' ); function my_register_merge_tags(){ require_once 'class.mergetags.php'; Ninja_Forms()->merge_tags[ 'my_merge_tags' ] = new My_MergeTags(); }
And then it needs to use this code to display the add to Google Calendar link:
setup_postdata($id); echo '<a class="tribe-events-gcal tribe-events-button" href="' . Tribe__Events__Main::instance()->esc_gcal_url( tribe_get_gcal_link() ) . '" title="' . esc_attr__( 'Add to Google Calendar', 'the-events-calendar' ) . '" target="_blank"' . ' >+ ' . esc_html__( 'Google Calendar', 'the-events-calendar' ) . '</a>'; reset_post_data();
But I couldn’t seem to get this working together. If anyone has some tips or suggestions, it would be greatly appreciated.
- The topic ‘Ninja Forms merge tags and Events Calendar Pro’ is closed to new replies.