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 | |
add_filter( 'leaky_paywall_nag_message_text', 'zeen_lp_nag_by_cat', 20, 2 ); | |
function zeen_lp_nag_by_cat( $text, $post_id ) { | |
$cats = get_the_category( $post_id ); | |
foreach( $cats as $cat ) { | |
if ( $cat->name == 'Blues' ) { | |
return 'For all the Blues content, please subscribe.'; | |
} else if ( $cat->name == 'Jazz' ) { | |
return 'For all the Jazz content, please subscribe.'; | |
} | |
} | |
return $text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment