From 75c411b3bf662082c895d5b50c64bc98835281e7 Mon Sep 17 00:00:00 2001 From: Mohamad Nateqi Rostami Date: Wed, 3 Apr 2024 13:42:03 +0330 Subject: [PATCH] Improvement --- includes/class-wcpdf-admin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/class-wcpdf-admin.php b/includes/class-wcpdf-admin.php index 3ed5d79f6..9a14ef45e 100644 --- a/includes/class-wcpdf-admin.php +++ b/includes/class-wcpdf-admin.php @@ -1348,7 +1348,9 @@ public function ajax_fetch_pdf_document_data(): void { wp_send_json_success( $documents_data ); } - wp_die(); + wp_send_json_error( array( + 'message' => esc_html__( 'Documents data is empty!', 'woocommerce-pdf-invoices-packing-slips' ), + ) ); } }