Don't know if this is true, but here goes my theory: Ryan tries to bring someone to a 404 page when some condition is not met. So why not if { bla() } else { wp_redirect('wherever', 404) } ?