Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created March 28, 2019 15:38
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 Pebblo/5a94209a3add14a7b789b4bf0d6ba008 to your computer and use it in GitHub Desktop.
Save Pebblo/5a94209a3add14a7b789b4bf0d6ba008 to your computer and use it in GitHub Desktop.
Example of how to alter the links within the 'attention box' on the EE thank you page to open in a new window.
<?php //Please do not include the opening PHP tag if you already have one
function ee_add_target_blank_to_thank_you_page_links() {
wp_add_inline_script(
'thank_you_page',
'jQuery( document ).ready(function($) {
$("#espresso-thank-you-page-overview-dv .ee-attention a").each(function() {
$(this).attr("target","_blank");
});
});'
);
}
add_action( 'wp_enqueue_scripts', 'ee_add_target_blank_to_thank_you_page_links', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment