Skip to content

Instantly share code, notes, and snippets.

@webdados
Created December 30, 2025 11:20
Show Gist options
  • Select an option

  • Save webdados/44439b513e96a091ca51c4ab4ed3e140 to your computer and use it in GitHub Desktop.

Select an option

Save webdados/44439b513e96a091ca51c4ab4ed3e140 to your computer and use it in GitHub Desktop.
Change InvoiceXpress for WooCommerce document filename
<?php
add_filter( 'invoicexpress_woocommerce_document_filename', 'my_invoicexpress_woocommerce_document_filename', 10, 6 );
function my_invoicexpress_woocommerce_document_filename( $file_name, $order_object, $document_url, $document_type, $invoicexpress_id, $another_doc ) {
$new_filename = $document_type . '-' . $order_object->get_order_number() . '.pdf';
return $new_filename;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment