Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make the price field optional for marketplace listings #hivepress #marketplace
<?php
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['price'] ) ) {
$attributes['price']['edit_field']['required'] = false;
}
return $attributes;
},
1000
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment