change string – pdf invoice change to “receipt”

[ad_1]

I would like to change invoice to “receipt” I tried it with a function but it didn’t work. Can you take a look at it?

add_filter( ‘wpo_wcpdf_filename’, ‘wpo_wcpdf_custom_filename’, 10, 4 );
function wpo_wcpdf_custom_filename( $filename, $template_type, $order_ids, $context ) {
    $invoice_string = _n( ‘invoice’, ‘invoices’, count($order_ids), ‘woocommerce-pdf-invoices-packing-slips’ );
    $new_prefix = _n( ‘receipt’, ‘receipts’, count($order_ids), ‘woocommerce-pdf-invoices-packing-slips’ );
    $new_filename = str_replace($invoice_string, $new_prefix, $filename);

    return $new_filename;
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer