action = $action; } public function run() { $this->request = new Regular_Request(); $this->request->fill_with_context( $this->request_context ); $result = $this->action->handle( $this ); if ( ! $result ) { return null; } return $result->feed_consumer( $this ); } /** * @param $user_id * * @return \WP_User */ public function consume_user( $user_id ) { return new \WP_User( $user_id ); } /** * @param $html */ public function consume_html( $html ) { echo $html; exit(); } /** * @param $error * * @return mixed * @throws \Exception */ public function consume_error( $error ) { if ( ! is_a( $error, '\WP_Error' ) ) { throw new TwoFASLight_Exception( 'Unexpected response type from request handler' ); } return $error; } }