Created
September 30, 2019 17:17
-
-
Save danielbachhuber/b246b33539b7a0fec276fd553be80e11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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