$location, 'status' => $status, ] ); throw new Exception( $error_msg ); } /** * Stop halting redirects. * Use this in a tearDown() method in the test suite. */ public function stopRedirectHalting() { remove_filter( 'wp_redirect', [ $this, 'haltRedirect' ], 1 ); } }