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_Certificates::get_export_html( int $certificate_id )

Retrieves the HTML of a certificate which can be used to create an exportable download

Parameters Parameters


(int) (Required) WP_Post ID of the earned certificate.

Top ↑

Return Return

(WP_Error|string) HTML of the certificate on success, otherwise an error object.

Top ↑

Source Source

File: includes/class.llms.certificates.php

	private function get_export_html( $certificate_id ) {

		// Retrieve the raw HTML of the page.
		$html = $this->scrape_certificate( $certificate_id );
		if ( is_wp_error( $html ) ) {
			return $html;

		// Modify the DOM.
		$html = $this->modify_dom( $html );

		 * Modify the HTML of a certificate export.
		 * @since  3.18.0
		 * @param string $html           HTML to be exported.
		 * @param int    $certificate_id WP_Post ID of the earned certificate.
		return apply_filters( 'llms_get_certificate_export_html', $html, $certificate_id );


Top ↑

Changelog Changelog

Version Description
4.8.0 Remove redundant check for the presence of DOMDocument.
4.3.1 If $this->scrape_certificate() generates a WP_Error early return it.
3.37.3 Refactored method into multiple functions.
3.24.3 Unknown.
3.18.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.