Created
September 21, 2021 22:59
-
-
Save greenhornet79/9cdf5d1fa8cad99b02538095a9ebb2be 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 | |
add_action('wp', 'zeen_redirect_if_no_access'); | |
function zeen_redirect_if_no_access() | |
{ | |
$restricted_page_id = 79791; | |
$settings = get_leaky_paywall_settings(); | |
if (!leaky_paywall_user_has_access() && $restricted_page_id == get_the_ID()) { | |
wp_redirect(get_page_link($settings['page_for_subscription'])); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment