Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created May 9, 2024 12:20
Show Gist options
  • Save webtoffee-git/632fb3bdeb2be290da99f2911b13b8b9 to your computer and use it in GitHub Desktop.
Save webtoffee-git/632fb3bdeb2be290da99f2911b13b8b9 to your computer and use it in GitHub Desktop.
to alter/translate the 'Print Invoice' button string present on the WooCommerce email
<?php //Do not add this line of code
add_filter("wt_pklist_alter_document_button_label","wt_pklist_alter_document_button_label_email",10,4);
function wt_pklist_alter_document_button_label_email($print_btn_label,$print,$loco,$template_type){
if( 'invoice' === $template_type ){
if( 'email' === $loco ){
$print_btn_label = __("Print your Invoice","print-invoices-packing-slip-labels-for-woocommerce");
}
}
return $print_btn_label;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment