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.
]]>