Last active
January 28, 2017 08:28
-
-
Save WillBrubaker/2bf13e141a739b612b67 to your computer and use it in GitHub Desktop.
Removes cost indicator from WooCommerce Bookings resources dropdown
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 = '#\(\+<span class="amount">.*\)#'; | |
$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