Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/ayoubkhan558/bricks-dialcode/archive/refs/heads/master.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Adds a country flag and dial-code dropdown to Bricks Builder phone fields.
How it works
- Enhances Bricks form fields using
input[type="tel"]. - Shows country flags and separate dial codes.
- Converts the field value to an international number before the form submits.
- Handles dynamically loaded Bricks content.
Usage
- Put this folder in
wp-content/plugins/. - Activate Bricks DialCode in WordPress.
- In Bricks Builder, add a form phone field or set a field type to
tel. - Open the Form element settings, go to Dial code phone, and set Phone country dropdown to Enable.
Bricks controls
The plugin adds a Dial code phone group to the Bricks Form element.
- Phone country dropdown: Enable or disable the dropdown for this form.
- Favorite countries: Comma-separated ISO country codes shown first in the dropdown, for example
pk,us,gb,ae. Common names likePakistan,United States,UK, andUAEare also accepted, but ISO codes are safest. - Show flags: Show or hide country flags in the selected country button and dropdown list.
- Default country: Use
auto, leave empty, or enter one ISO country code likepk.
To enhance a custom phone input outside a Bricks form, add this class:
bricks-dialcode-phone
Developer filters
add_filter( 'bricks_dialcode_initial_country', fn() => 'pk' );
add_filter( 'bricks_dialcode_country_order', fn() => array( 'pk', 'us', 'gb', 'ae' ) );
Available filters:
bricks_dialcode_selectorbricks_dialcode_initial_countrybricks_dialcode_fallback_countrybricks_dialcode_country_orderbricks_dialcode_only_countriesbricks_dialcode_exclude_countriesbricks_dialcode_initial_country_lookup