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
);
@bidhi108
Copy link

I would like to hide the default description box for the listing, as it is not possible to make any changes made in the description area by customer to be manually approved by admin. So any way I can hide the listing description box so that it does not show when uploading or editing the listing.?

@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