Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Controller_Certificates::download( $cert_id )
Generates an HTML export of the certificate from the “Download” button on the View Certificate front end & on reporting backend for admins
Description Description
Return Return
(void)
Source Source
File: includes/controllers/class.llms.controller.certificates.php
private function download( $cert_id ) { $filepath = LLMS()->certificates()->get_export( $cert_id ); if ( is_wp_error( $filepath ) ) { // @todo need to handle errors differently on admin panel return llms_add_notice( $filepath->get_error_message() ); } header( 'Content-Description: File Transfer' ); header( 'Content-Type: application/octet-stream' ); header( 'Content-Disposition: attachment; filename="' . basename( $filepath ) . '"' ); readfile( $filepath ); // delete file after download ignore_user_abort( true ); wp_delete_file( $filepath ); exit; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.18.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: