llms_certificate_styles()

Outputs dynamic CSS for a single certificate template.


Description Description

Hooked to action wp_head at priority 10.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/functions/llms.functions.templates.certificates.php

function llms_certificate_styles() {

	$certificate = llms_get_certificate( get_the_ID(), true );
	if ( ! $certificate || 1 === $certificate->get_template_version() ) {
		return;
	}

	$image          = $certificate->get_background_image();
	$background_img = $image['src'];

	$background_color = $certificate->get( 'background' );

	$padding = implode( ' ', $certificate->get_margins( true ) );

	$dimensions = $certificate->get_dimensions_for_display();
	$width      = $dimensions['width'];
	$height     = $dimensions['height'];

	$fonts = $certificate->get_custom_fonts();

	llms_get_template(
		'certificates/dynamic-styles.php',
		compact( 'certificate', 'width', 'height', 'background_color', 'background_img', 'padding', 'fonts' )
	);
}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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