Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.