Skip to content

Commit

Permalink
New: deprecated wpo_wcpdf_due_date_display hook (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadNateqi authored Oct 10, 2024
1 parent 828deae commit 44f5d23
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions includes/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ private function tmp_folders_exist_and_writable()
public function copy_fonts( $path = '', $merge_with_local = true ) {
// only copy fonts if the bundled dompdf library is used!
$default_pdf_maker = '\\WPO\\IPS\\Makers\\PDFMaker';

if ( $default_pdf_maker !== apply_filters( 'wpo_wcpdf_pdf_maker', $default_pdf_maker ) ) {
return;
}
Expand Down Expand Up @@ -1646,8 +1646,19 @@ function_exists( 'WPO_WCPDF_Templates' ) &&
return;
}

$due_date = apply_filters( 'wpo_wcpdf_due_date_display', date_i18n( wcpdf_date_format( $this, 'due_date' ), $due_date_timestamp ), $due_date_timestamp, $document_type, $document );
$due_date_title = is_callable( array( $document, 'get_due_date_title' ) ) ? $document->get_due_date_title() : __( 'Due Date:', 'woocommerce-pdf-invoices-packing-slips' );
$due_date = apply_filters_deprecated(
'wpo_wcpdf_due_date_display',
array(
date_i18n( wcpdf_date_format( $this, 'due_date' ), $due_date_timestamp ),
$due_date_timestamp,
$document_type,
$document
),
'3.9.0',
'wpo_wcpdf_document_due_date'
);
$due_date_title = is_callable( array( $document, 'get_due_date_title' ) ) ?
$document->get_due_date_title() : __( 'Due Date:', 'woocommerce-pdf-invoices-packing-slips' );

if ( ! empty( $due_date ) ) {
echo '<tr class="due-date">
Expand Down

0 comments on commit 44f5d23

Please sign in to comment.