Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active April 2, 2018 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/45aae4b28d4037d0a22634602a374b20 to your computer and use it in GitHub Desktop.
Save tripflex/45aae4b28d4037d0a22634602a374b20 to your computer and use it in GitHub Desktop.
WP Job Manager Field Editor phone field type, set default country (to Italy)
<?php
// Add this code to your functions.php file (omit the <?php at the top), or use the Code Snippets plugin (include everything)
add_filter( 'job_manager_field_editor_phone_args', 'smyles_custom_phone_args' );
function smyles_custom_phone_args( $args ){
// Other available arguments, see GitHub for details
// https://github.com/jackocnr/intl-tel-input/tree/8a2364bc0459fce934d7cf04a82823db63e7944b
//
// Country codes can be found here:
// https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
//
// $args['allowExtensions'] = 'false';
// $args['autoFormat'] = 'true';
// $args['autoHideDialCode'] = 'false';
// $args['autoPlaceholder'] = 'true';
// $args['ipinfoToken'] = '';
// $args['nationalMode'] = 'true';
$args['preferredCountries'] = array( 'it' );
$args['defaultCountry'] = 'it';
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment