Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save tripflex/14005f5ff70edfd68a38 to your computer and use it in GitHub Desktop.

Select an option

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