Skip to content

Instantly share code, notes, and snippets.

@trishasalas
Created May 10, 2017 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trishasalas/26a90dbbc05f93100664a5e356ad74d0 to your computer and use it in GitHub Desktop.
Save trishasalas/26a90dbbc05f93100664a5e356ad74d0 to your computer and use it in GitHub Desktop.
<?php
$event_id = get_the_ID();
$book_now_link = get_post_meta( $event_id, 'book_now_link', true );
$book_now_text = get_post_meta( $event_id, 'book_now_text', true );
if ( ! empty ( $book_now_link || $book_now_text ) ) : ?>
<a class="button" href="<?php echo esc_url( $book_now_link );?>">
<?php echo esc_html( $book_now_text );?>
</a>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment