This file contains hidden or 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_send_new_email', 'zeen_filter_send_emails', 10, 2 ); | |
function zeen_filter_send_emails( $send, $user_id ) { | |
$mode = leaky_paywall_get_current_mode(); | |
$site = leaky_paywall_get_current_site(); | |
$level_id = get_user_meta($user_id, '_issuem_leaky_paywall_' . $mode . '_level_id' . $site, true); |
This file contains hidden or 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 | |
$visibility = get_post_meta(get_the_ID(), '_issuem_leaky_paywall_visibility', true ); | |
$current_user_level_id = leaky_paywall_subscriber_current_level_id(); | |
if ( isset($visibility['visibility_type'] ) && $visibility['visibility_type'] == 'always' && $visibility['always_visible'][0] == -1 ) { | |
$show_to_everyone = true; | |
} else { | |
$show_to_everyone = false; | |
} |
This file contains hidden or 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('random_password', 'endo_disable_random_password', 10, 4); | |
function endo_disable_random_password($password, $length, $special_chars, $extra_special_chars) | |
{ | |
global $action; | |
if ('wp-login.php' === $GLOBALS['pagenow'] && in_array($action, ['rp', 'resetpass', 'login'])) { | |
$password = ''; |
This file contains hidden or 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_filter_is_restricted', 'zeen101_bypass_in_custom_tax', 10, 3); | |
function zeen101_bypass_in_custom_tax($is_restricted, $restriction_settings, $post_id) | |
{ | |
$exclude_term_id = 54; // term id that should never be restricted | |
$terms = get_the_terms( $post_id, 'topic' ); // adjust the name of the custom taxonomy here |
This file contains hidden or 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_filter_is_restricted', 'zeen_bypass_this_user_agent', 20, 3 ); | |
function zeen_bypass_this_user_agent( $is_restricted, $settings, $post_id ) { | |
$bypass_value = 'Googlebot'; | |
if ( isset($_SERVER['HTTP_USER_AGENT'] ) ) { |
This file contains hidden or 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_action ('admin_init', 'zeen_restore_level_by_id' ); | |
function zeen_restore_level_by_id() { | |
$settings = get_leaky_paywall_settings(); | |
$level_id = 1; // the id of the level you want to restore | |
$settings['levels'][$level_id]['deleted'] = 0; // this will "undelete" the level |
This file contains hidden or 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_cancel_subscription_description', 'endo_change_cancel_description' ); | |
function endo_change_cancel_description( $description ) { | |
$new_description = '<p>Please click the first link below to cancel your subscription.</p>'; | |
return $new_description; | |
} |
This file contains hidden or 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 toc field to registration form | |
add_action('leaky_paywall_after_password_registration_field', 'zeen_custom_tos_registration_fields'); | |
function zeen_custom_tos_registration_fields() | |
{ | |
?> | |
<div class="form-row"> | |
<input style="display: inline;" type="checkbox" required id="tos" name="tos"> <label for="tos" style="display: inline;">I understand I will be automatically billed on my renewal date unless I cancel, and I agree to all <a target="_blank" href="<?php echo home_url('subscription-terms'); ?>">terms and conditions</a>.</label> |
This file contains hidden or 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_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 ''; |