You are here

function CC_formatter_local in Phone Number 7

Same name and namespace in other branches
  1. 6 includes/API.php \CC_formatter_local()

Local formatter for local phone number.

Parameters

$element: $element['#item']['country_codes']: alpha-2 country code $element['#item']['number']: phone number

$error: The error message to shown to user. Available parameters to use in the error message are

  • "%countrycode": the alpha-2 CC
  • "%phone_input": the original number input by user (could be invalid)
  • "%max_length": allowed maximum length of the phone number

Return value

boolean TRUE if it is a valid phone number for that country, FALSE otherwise.

File

includes/API.php, line 159
Phone Number custom country API

Code

function CC_formatter_local($element) {

  // Display a local phone number without country code.
  // Format the phone number however you like, this is the default
  $phone = $element['#item']['number'];
  return $phone;
}