Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Plugin Name: Bloqueio do Andersu
- * Description: Bloqueia certas páginas para usuários logados.
- * Version: 1.0.0
- */
- add_action( 'init', 'bda_redirect_logged' );
- function bda_redirect_logged() {
- if ( ! is_user_logged_in() ) {
- return;
- }
- $blocked = [ 'minha-page', 'outra-pagina' ];
- foreach ( $blocked as $page ) {
- if ( ! is_page( $page ) ) {
- continue;
- }
- wp_redirect( home_url(), 302 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement