Add a placeholder text for the description field

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.

1 Like

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
);
1 Like

Thanks, doing the job great.

1 Like

Thanks for the booking note snippet, it works great. I have 2 questions regarding this.

  1. I want more than just 1 row, I want 3 rows - for name, phone, email.
  2. 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.