Phone numer format | WordPress.org

[ad_1]

Hi @wph4x,

This is not something controlled by our plugin. I guess this phone formatting is something added by WooCommerce, another plugin, or a code snippet.

However, you can try using this code to remove that formatting in the PDF documents:

/**
 * WooCommerce PDF Invoices & Packing Slips:
 * Remove spaces and special characters (except +) from billing/shipping phone number in the PDF documents 
 * E.g. this number: +1-555-123-4567, will be converted to this: +15551234567
 */
add_filter( 'wpo_wcpdf_billing_phone', 'wpo_format_phone_number_with_dashes', 10, 2 );
add_filter( 'wpo_wcpdf_shipping_phone', 'wpo_format_phone_number_with_dashes', 10, 2 );
function wpo_format_phone_number_with_dashes( $phone, $document ) {
	$phone = preg_replace( '/[^+|^0-9]/', '', $phone );
	return $phone;
}

If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

 

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