• I already had a user_meta field called phonenumber.
    WP_Invoice correctly displays the phone numbers that are already on file when editing an invoice.
    But (sometimes) when saving an invoice the phone number gets set to blank.
    Your code tests for a number with two dashes (e.g. 123-456-7890) or 10 digits.
    It changes the ten digits into the format with dashes. Anything else is replaced with ”.
    Works Canada suggests 123 456-7890 (one dash).

    The comment says
    “Prevent entering of wrong phone number to avoid errors on front-end.”

    Why is the formatting of phone numbers so strict and why is a wrongly formatted number silently set to blank?

  • The topic ‘Phone Number set to blank’ is closed to new replies.