Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* REDIRECT PRIVATE PAGES TO LOGIN */
- function tessera_redirect_private_content() {
- global $wp_query, $wpdb;
- if ( is_404() ) {
- $current_query = $wpdb->get_row($wp_query->request);
- if( 'private' == $current_query->post_status ) {
- wp_redirect( home_url('/') );
- exit;
- }
- }
- }
- add_action( 'template_redirect', 'tessera_redirect_private_content', 9 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement