diff --git a/includes/documents/abstract-wcpdf-order-document.php b/includes/documents/abstract-wcpdf-order-document.php index fff9b18c8..3a5041cd5 100644 --- a/includes/documents/abstract-wcpdf-order-document.php +++ b/includes/documents/abstract-wcpdf-order-document.php @@ -326,7 +326,12 @@ public function set_date( $value, $order = null ) { public function set_number( $value, $order = null ) { $order = empty( $order ) ? $this->order : $order; - if ( empty( $value ) || ( is_array( $value ) && empty( array_filter ( $value ) ) ) ) { + + if ( is_array( $value ) ) { + $filtered_value = array_filter( $value ); + } + + if ( empty( $value ) || ( is_array( $value ) && empty( $filtered_value ) ) ) { $document_number = null; } elseif ( is_array( $value ) ) { // WCPDF 2.0 number data