Last active
September 28, 2022 22:15
-
-
Save greenhornet79/514a21de87a9d26d5c5b6935b684c126 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( 'template_redirect', 'zeen101_custom_redirects' ); | |
function zeen101_custom_redirects() { | |
if ( !is_category() ) { | |
return; | |
} | |
$allowed_cat_ids = array( 4,9 ); | |
if ( !is_category( $allowed_cat_ids ) && !leaky_paywall_user_has_access() ) { | |
wp_redirect( home_url( '/subscribe/' ) ); | |
die; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment