
The Phone field can store a telephone number in various formats including international.
Contents
Quick Start
- Fill out the Basic Field Settings (Label, Description, and Field Name)
- Select Field Type: Phone.
- Click Save New Field (or Save Field if you’re updating an existing field) to save your field configuration.
Settings
- Format
The Format options provide a validation for your field to ensure values will be saved/displayed as you expect them to be. If you want dashes or dots, it will automatically reformat the number for that. If you prefer parenthesis, it can enforce that too. Choose the one that most fits what you need or chooseAny (no validation available)to have no requirement at all. The options are:- US
- 123-456-7890 x123
- (123) 456-7890 x123
- 123.456.7890 x123
- International
- Any (no validation available)
- US
- Phone Options
- Enable Phone Extension
When enabled, it will allow extensions in the US-based formats. When disabled, it will remove them.
- Enable Phone Extension
- Enable HTML5 Input Field
When enabled, this will render the field withtype="tel"using the default browser interface. Based on your needs, the browser interface may be a better experience especially for mobile devices. For more details on HTML5 types, you can read the documentation at W3 on Validating Common Input. - Maximum Length
The maximum length of text to allow (default: 25), you can set it to -1 to disable the limit. - HTML Placeholder
This is the text that will show on the input field when it is empty to help guide content entry. The placeholder is not a replacement for labels or description text, and it is less accessible for people using screen readers. For more details on the usage of Placeholder Text, you can read the documentation at W3 on Placeholders.
How to Display
Display with a Shortcode
[pods field="my_phone_field"]
Display with PHP: pods_field_display()
<?php echo pods_field_display( 'my_phone_field' );
Display with PHP: $pod->display()
<?php $pod = pods(); echo $pod->display( 'my_phone_field' );