learndash_certificate_params

apply_filters( 'learndash_certificate_params',  array $tcpdf_params,  int $cert_id )

Filters certificate tcpdf paramaters.


Description #


Parameters #

$tcpdf_params

(array) An array of tcpdf parameters.

$cert_id

(int) Certificate post ID.


Source #

File: includes/ld-convert-post-pdf.php


Examples #

 <?php
/**
 * Example usage for learndash_certificate_params filter.
 */
add_filter(
	'learndash_certificate_params',
	function ( $tcpdf_params = array(), $post_id = 0 ) {

		if ( ( isset( $tcpdf_params['margins'] ) ) && ( is_array( $tcpdf_params['margins'] ) ) ) {
			$tcpdf_params['margins']['top']    = 0;
			$tcpdf_params['margins']['right']  = 0;
			$tcpdf_params['margins']['bottom'] = 0;
			$tcpdf_params['margins']['left']   = 0;
		}

		// Always return $tcpdf_params
		return $tcpdf_params;
	},
	30,
	2
);
 

Changelog #

Changelog
Version Description
2.4.7 Introduced.