[wp-hackers] How to redirect to login when filtered posts are empty?

David Coppit david at coppit.org
Tue Jul 31 14:17:06 GMT 2007

Hi all,

wp-includes/classes.php around line 292 has this:


My Category Access plugin filters out posts for which the user does not
have permissions. When using a permalink to the post, this causes
$wp_query->posts to be empty, which in turn causes handle_404 to print a

My question is this: Is there some way to get WP to redirect to the login
screen in this case instead of showing a 404 message?


David Coppit                           david at coppit.org
The College of William and Mary        http://coppit.org/

"When the president does it that means that it is not illegal."
- Richard Nixon on domestic surveillance, 5/19/1977
"Do I have the legal authority to do this? And the answer is, absolutely."
- George W. Bush on domestic surveillance, 12/19/2005

More information about the wp-hackers mailing list