Last active
April 2, 2018 21:41
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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