Skip to content

Instantly share code, notes, and snippets.

@hivepress
Last active July 26, 2023 17:21
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hivepress/da2e25219ed47ede2a92f1090303c44d to your computer and use it in GitHub Desktop.
Change the price display format for bookable listings #hivepress #listings #bookings
<?php
add_filter(
'hivepress/v1/models/listing/fields',
function( $fields, $model ) {
if ( isset( $fields['price'] ) ) {
$fields['price']['display_template'] = '%value% / day';
}
return $fields;
},
1000,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment