Home › Forums › Calendar Products › Event Aggregator › Facebook Event Link not displaying
- This topic has 4 replies, 3 voices, and was last updated 7 years, 6 months ago by Wade.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
October 17, 2016 at 1:35 pm #1177923WadeParticipant
function tribe_link_to_fb_event() { // Check if the event is associated with a Facebook event $fbid = tribe_get_event_meta( get_the_ID(), '_FacebookID' ); if ( empty( $fbid ) ) return; // Form and display a link to the FB event page if so echo '<p class="mt0 mb3"><a class="tribe-events-button" href="' . esc_url( "http://facebook.com/events/$fbid/" ) .'" target="_blank" rel="nofollow">RSVP on Facebook</a></p>'; }
The code in the above snippet found in the knowledge base returns nothing now, what is the updated snippet?
October 17, 2016 at 1:48 pm #1177938WadeParticipantFound it.
_EventFacebookID
is the new post meta ID…really curious why you thought it was a good idea to change that field…October 17, 2016 at 2:20 pm #1177953WadeParticipantUpdated snippet if anyone else needs it, with fallback for the legacy ID:
<?php // Check if the event is associated with a Facebook event $fbid_legacy = tribe_get_event_meta( get_the_ID(), '_FacebookID' ); $fbid_new = tribe_get_event_meta( get_the_ID(), '_EventFacebookID'); if( !empty($fbid_new )) { $fbid = $fbid_new; } else { $fbid = $fbid_legacy; } if ( !empty( $fbid ) ) { // Form and display a link to the FB event page if so echo '<a class="mt1 tribe-events-button" href="' . esc_url( "http://facebook.com/events/$fbid/" ) .'" target="_blank" rel="nofollow">RSVP on Facebook</a>'; } ?>
October 17, 2016 at 8:38 pm #1178128CliffMemberHi Wade.
Sorry to cause you a little extra headache in the transition. It does use a new meta key, as you’ve discovered.
And thanks for sharing your updated snippet!
Have a great week.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Facebook Event Link not displaying’ is closed to new replies.