Created
September 14, 2013 17:28
-
-
Save theukedge/6563869 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 | |
// FILTER POST CONTENT FOR PARDOT | |
function filter_post_content_pardot($content) { | |
if( get_post_meta( get_the_ID(), 'pardot_protected', true ) == 'protected' && !is_user_logged_in() && !isset( $_COOKIE['email-to-pardot'] ) ) { | |
return gravity_form(1, false, false, false) . '<p>This article is only available to subscribers to our newsletter. You may subscribe using the form above.</p>'; | |
} | |
else { | |
return $content; | |
} | |
} | |
add_filter( 'the_content', 'filter_post_content_pardot' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment