Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Last active December 19, 2022 18:48
Embed
What would you like to do?
<?php
add_filter( 'leaky_paywall_subscribe_or_login_message', 'zeen_hide_nag', 20, 4 );
function zeen_hide_nag( $new_content, $message, $content, $post_id ) {
// return either original content or an empty string
// return $content;
return '';
}
// adjust content of the zero nag
add_filter( 'leaky_paywall_acn_zero_screen', 'zeen_adjust_zero_nag', 20, 2 );
function zeen_adjust_zero_nag( $content, $post_id ) {
$visibility = get_post_meta( $post_id, '_issuem_leaky_paywall_visibility', true );
ob_start(); ?>
<?php if ( !isset( $visibility['visibility_type'] ) || $visibility['visibility_type'] == 'default' ) {
// default zero nag
?>
<div class="acn-zero-remaining-overlay"></div>
<div id="issuem-leaky-paywall-articles-zero-remaining-nag">
<div id="issuem-leaky-paywall-articles-remaining-close">&nbsp;</div>
<div id="issuem-leaky-paywall-articles-remaining">
<h2 style="margin-bottom: 20px; font-size: 24px;">You have not articles left!</h2>
<p style="margin-bottom: 40px;">Subscribe today to get all of our content.</p>
<h2 style="font-size: 24px;"><a href="#">Subscribe Today</a></h2>
</div>
</div>
<?php
} else {
// special case zero nag
?>
<div class="acn-zero-remaining-overlay"></div>
<div id="issuem-leaky-paywall-articles-zero-remaining-nag">
<div id="issuem-leaky-paywall-articles-remaining-close">&nbsp;</div>
<div id="issuem-leaky-paywall-articles-remaining">
<h2 style="margin-bottom: 20px; font-size: 24px;">This is special content!</h2>
<p style="margin-bottom: 40px;">Subscribe today to get all of our content.</p>
<h2 style="font-size: 24px;"><a href="#">Subscribe Today</a></h2>
</div>
</div>
<?php
} ?>
<?php $content = trim( ob_get_contents() );
ob_end_clean();
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment