how can i add a placeholder text for the discription field when a user wishes to add a listing
Hi,
Please try this PHP snippet:
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
if(isset($form['fields']['description'])){
$form['fields']['description']['placeholder'] = 'custom text here';
}
return $form;
},
1000
);
Please note that it can require further customization.
How do i modify this snippet for the Booking Note
Hi,
Please try this PHP snippet:
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['purchase_note'] ) ) {
$attributes['purchase_note']['edit_field']['description'] = 'custom text here';
}
return $attributes;
},
1000
);
thanks but this changes the text in the description under Booking Note its not adding a placeholder, i tried to play around but was unsuccessful.
Hi,
Sorry for the confusion, please try this PHP snippet:
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['purchase_note'] ) ) {
$attributes['purchase_note']['edit_field']['placeholder'] = 'custom text here';
}
return $attributes;
},
1000
);
Thanks, doing the job great.
Thanks for the booking note snippet, it works great. I have 2 questions regarding this.
- I want more than just 1 row, I want 3 rows - for name, phone, email.
- After creating 3 rows, is it possible to make the 3 rows mandatory? I already applied a code that makes the entire booking note mandatory. Can I make all 3 rows individually mandatory? So they shouldn’t be able to submit a listing without filling in these 3 details.
See attached of what I mean to say.
Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work https://fvrr.co/32e7LvY
Is this possible to add just ‘custom text here’ it should be on 3 rows?
Thanks
Please try this PHP snippet
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['purchase_note'] ) ) {
$attributes['purchase_note']['edit_field']['placeholder'] = 'custom text here';
}
return $attributes;
},
1000
);
Works! Thanks!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.