fix: ensure autoloader is available for TCPDF check

Added a condition to require the composer autoload file if the autoloader is available before checking for the TCPDF class. This change ensures that the TCPDF library is properly loaded, preventing potential errors caused by missing dependencies.
This commit is contained in:
Kumi 2024-08-02 21:56:10 +02:00
parent d901010399
commit 32cbcedc52
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -725,6 +725,9 @@ add_filter('login_headertext', 'custom_login_logo_url_title');
// Check if TCPDF is available
function is_tcpdf_available()
{
if (is_autoloader_available()) {
require_once get_template_directory() . '/vendor/autoload.php';
}
return class_exists('TCPDF');
}