Wade

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Facebook Event Link not displaying #1177953
    Wade
    Participant

    Updated 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>';
    			}
    		?>
    in reply to: Facebook Event Link not displaying #1177938
    Wade
    Participant

    Found it.

    _EventFacebookID is the new post meta ID…really curious why you thought it was a good idea to change that field…

Viewing 2 posts - 1 through 2 (of 2 total)