Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function redirect() {
- if(true === $something) {
- /* @var WP_Query $wp_query */ global $wp_query;
- $wp_query->set_404();
- status_header( 404 );
- get_template_part( '404' );
- exit();
- }
- }
- add_action( 'template_redirect', 'redirect' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement