Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active August 29, 2015 14:18
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/14005f5ff70edfd68a38 to your computer and use it in GitHub Desktop.
Save tripflex/14005f5ff70edfd68a38 to your computer and use it in GitHub Desktop.
Auto set phone field type flag by visitors IP, and set country(s) at top of list
<?php
add_filter( 'job_manager_field_editor_phone_args', 'my_custom_phone_args' );
function my_custom_phone_args( $args ){
// Other available arguments, see GitHub for details
// https://github.com/Bluefieldscom/intl-tel-input#options
//
// $args['allowExtensions'] = 'false';
// $args['autoFormat'] = 'true';
// $args['autoHideDialCode'] = 'false';
// $args['autoPlaceholder'] = 'true';
// $args['ipinfoToken'] = '';
// $args['nationalMode'] = 'true';
$args['preferredCountries'] = array( 'iq' );
$args['defaultCountry'] = 'auto';
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment