[wp-hackers] Throw 404 error via plugin
will at itsananderson.com
Thu Jan 13 05:48:58 UTC 2011
404 isn't a redirect, it's a not found error. These are, for the most part,
completely different problems.
Ryan, when you call set_404() on init, it sets the $wp_query->is_404
variable to true, but when $wp_query is actually constructed (after init),
init_query_flags() is called, which will set $wp_query->is_404 to false
again. You need to hook into pre_get_posts so that your changes to $wp_query
On Thu, Jan 13, 2011 at 12:33 AM, 24/7 <24-7 at gmx.net> wrote:
> I'm trying to achieve something similar with my init class and opened
> an thread just some minutes before you .
> Maybe you got more luck with my code and get a 404-redirect working.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers