Skip to content

Instantly share code, notes, and snippets.

@whybhagi
Created July 31, 2015 11:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whybhagi/8d908041ba4f1a01efc4 to your computer and use it in GitHub Desktop.
Save whybhagi/8d908041ba4f1a01efc4 to your computer and use it in GitHub Desktop.
<?php
// Passing the Page ID so the merge tags will recognize it safely outside the loop
global $post;
echo '<a href="'. esc_url( add_query_arg( array( 'gfgd' => $post->ID ) , get_permalink( get_page_by_title( 'Submit Form' ) ) ) ) .'" >Submit Form</a>';
// Passing the Page ID so the merge tags will recognize it safely in the loop
echo '<a href="'. esc_url( add_query_arg( array( 'gfgd' => get_the_ID() ) , get_permalink( get_page_by_title( 'Submit Form' ) ) ) ) .'" >Submit Form</a>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment