Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions experimental/gpafp-replace-space-separator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Gravity Perks // Advanced Phone Field // Replace the space separator.
* https://gravitywiz.com/documentation/gravity-forms-advanced-phone-field/
*
* When the phone[nationalNumberFormatted] modifier is used, it seperates the phone number with a space.
* This snippet allows you to change the space seperator.
*/
add_filter( 'gpapf_merge_tag_value', function( $text, $modifiers ) {
if ( $modifiers['phone'] == 'nationalNumberFormatted' ) {
// Update '-' to any character you want to use as the seperator.
$text = str_replace( ' ', '-', $text );
}
return $text;
}, 10, 2 );