Last active
August 7, 2023 15:09
-
-
Save WillBrubaker/b05bdf91da70a8a44b8f969bfcac694a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'booking_form_fields', 'handsomebeardedguy_booking_form_fields' ); | |
function handsomebeardedguy_booking_form_fields( $fields ) { | |
if ( isset( $fields['wc_bookings_field_resource'] ) ) { | |
$pattern = '#\(\+*.*\)#'; | |
$replacement = ''; | |
foreach ( $fields['wc_bookings_field_resource']['options'] as $key => $value ) { | |
$fields['wc_bookings_field_resource']['options'][ $key ] = preg_replace( $pattern, $replacement, $value ); | |
} | |
} | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment