Skip to content

Instantly share code, notes, and snippets.

@hivepress
Last active July 16, 2024 11:29
Show Gist options
  • Save hivepress/c022e11f115836083afd426ef6e8dddf to your computer and use it in GitHub Desktop.
Save hivepress/c022e11f115836083afd426ef6e8dddf to your computer and use it in GitHub Desktop.
Make the listing description field optional #hivepress #listings
<?php
add_filter(
'hivepress/v1/models/listing',
function( $form ) {
$form['fields']['description']['required'] = false;
return $form;
},
1000
);
@hivepress
Copy link
Author

You can try using this snippet and also an extra one for the hivepress/v1/forms/listing_update hook to unset($form['fields']['description']), then the description should be not required and hidden.

You can also check another snippet which makes the description moderated, then any changes will send the listing to Pending status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment