From 32cbcedc5220d3301fd8aa45fbf9a3aa7165b472 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 2 Aug 2024 21:56:10 +0200 Subject: [PATCH] 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. --- functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions.php b/functions.php index 8a52041..964a3b1 100644 --- a/functions.php +++ b/functions.php @@ -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'); }