Skip to content

Instantly share code, notes, and snippets.

@danielbachhuber
Created September 30, 2019 17:17
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 danielbachhuber/b246b33539b7a0fec276fd553be80e11 to your computer and use it in GitHub Desktop.
Save danielbachhuber/b246b33539b7a0fec276fd553be80e11 to your computer and use it in GitHub Desktop.
<?php
/**
* Disable pinning on the print template.
*/
add_action( 'template_redirect', function() {
if ( function_exists( 'tasty_recipes_is_print' ) && tasty_recipes_is_print() ) {
add_action( 'wp_head', function() {
echo '<meta name="pinterest" content="nopin" description="Sorry, but please don\'t pin from the print page." />' . PHP_EOL;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment