get_body_params(); // All security validation is centralized in Validation_Handler::validate() $result = Validation_Handler::validate( $body ); return new WP_REST_Response( $result ); } /** * @param \WP_REST_Request $request * * @return Field_Data_Parser * @throws Plain_Value_Exception * @throws Repository_Exception */ protected function get_parser( \WP_REST_Request $request ): Field_Data_Parser { $body = $request->get_body_params(); $path = $body[ self::FIELD_KEY ] ?? false; $form_id = $body[ jet_fb_handler()->form_key ] ?? false; jet_fb_handler()->set_form_id( $form_id ); jet_fb_context()->set_request( $body ); jet_fb_context()->set_files( Request_Tools::get_files( $request->get_file_params() ) ); // set fields with request jet_fb_context()->apply( Block_Helper::get_blocks_by_post( $form_id ) ); return jet_fb_context()->resolve_parser( $path ); } public function get_parser_public( \WP_REST_Request $request ) { return $this->get_parser( $request ); } }