Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate wpo_wcpdf_due_date_display hook #884

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
alexmigf marked this conversation as resolved.
Show resolved Hide resolved
'wpo_wcpdf_due_date_display',
array(
date_i18n( wcpdf_date_format( $this, 'due_date' ), $due_date_timestamp ),
$due_date_timestamp,
$document_type,
$document
),
'3.8.7',
MohamadNateqi marked this conversation as resolved.
Show resolved Hide resolved
'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
Loading