Hi there,
I would like to hide certain fields from the vendor submission form that are a user attribute, but should only apply to buyers and are therefore redundant on the submission form. I know that vendors can still see them in their dashboard, but at least I want to hide them on the submission form. How can that be done?
Also, if at all possible, I would like to hide them on the user dashboard (make them only visible to non-vendor users), but I guess that is not possible?
Here is what I have been using to hide form parts that are built-in from Hivepress. hp_cif is the field from the user attributes I would like to hide.
add_filter(
'hivepress/v1/forms/vendor_submit',
function($form){
// Hide CIF field.
unset($form['fields']['hp_cif']);
// Hide booking window field.
unset($form['fields']['booking_window']);
// Hide maximum booking duration field.
unset($form['fields']['booking_max_length']);
// Hide min booking duration field.
unset($form['fields']['booking_min_length']);
// Hide min booking offset field.
unset($form['fields']['booking_offset']);
// Hide booking export url field.
unset($form['fields']['booking_export_url']);
return $form;
},
1000
);
andrii
October 2, 2024, 10:42am
4
Hi,
Here you need to use the hook on the vendor_update form.
I put this but it still shows up. Am I doing something wrong?
add_filter(
'hivepress/v1/forms/vendor_submit',
function($form){
// Hide CIF field.
unset($form['fields']['hp_cif']);
// Hide booking window field.
unset($form['fields']['booking_window']);
// Hide maximum booking duration field.
unset($form['fields']['booking_max_length']);
// Hide min booking duration field.
unset($form['fields']['booking_min_length']);
// Hide min booking offset field.
unset($form['fields']['booking_offset']);
// Hide booking export url field.
unset($form['fields']['booking_export_url']);
return $form;
},
1000
);
I updated it to vendor update form now, but still same result.
add_filter(
'hivepress/v1/forms/vendor_update',
function($form){
// Hide CIF field.
unset($form['fields']['hp_cif']);
// Hide booking window field.
unset($form['fields']['booking_window']);
// Hide maximum booking duration field.
unset($form['fields']['booking_max_length']);
// Hide min booking duration field.
unset($form['fields']['booking_min_length']);
// Hide min booking offset field.
unset($form['fields']['booking_offset']);
// Hide booking export url field.
unset($form['fields']['booking_export_url']);
return $form;
},
1000
);
andrii
October 3, 2024, 1:24pm
9
Hi,
Sorry for the confusion. Please use this hook: hivepress/v1/forms/user_update_profile
, if you want to delete the fields.
P.S. While we can provide general guidance, please consider hiring a freelance developer for in-depth customizations Experts | HivePress
1 Like
Thanks, that did the trick!