Skip to content

Instantly share code, notes, and snippets.

@hivepress
Last active April 6, 2023 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hivepress/c25a48d50dfeac2ba01512e680aebcf3 to your computer and use it in GitHub Desktop.
Save hivepress/c25a48d50dfeac2ba01512e680aebcf3 to your computer and use it in GitHub Desktop.
Make the budget field optional in the request form #hivepress #requests
<?php
add_filter(
'hivepress/v1/models/request/attributes',
function( $attributes ) {
if ( isset( $attributes['budget'] ) ) {
$attributes['budget']['edit_field']['required'] = false;
}
return $attributes;
},
1000
);
@anon1111404
Copy link

This doesnt work. Could you fix it?

@hivepress
Copy link
Author

Sorry for the late reply, for some reason I didn't receive the comment notification, the snippet is fixed now.

@posgross
Copy link

posgross commented Apr 5, 2023

Hi

I can't understand, it turns out that I can't change the offer form if I only have the Request plugin installed?

@hivepress
Copy link
Author

This snippet is for the Budget field of the request (not offer), the Budget field is available only if you have Marketplace because the budget defines the base price paid by customer when they accept an offer (by paying for it). If you don't have Marketplace you can still add a custom Budget attribute just for the price indication purposes.

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