Skip to content

Instantly share code, notes, and snippets.

@hivepress
Created April 26, 2022 17:29
  • Star 0 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
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