Add a '?' description hover box next to fields

Looking to add a description via the ‘?’ icon next to other categories like extras, add-ons, manual accept etc. to provide more guidance to users as to what each field indicates. Is this possible?

Hi, you are talking about in the admin’s back end correct? Because I do not think there are question marks in the front end when they are adding a listing. However, you can put descriptions in the front end via code snippets if you are talking about front end.

As far as the back end I have not seen it yet. But I can see how that can be helpful. Maybe Hivepress support can provide the answer to that question.

Oh you’re right! There are no question marks on the front end, but rather a small description line underneath each heading to help the user understand why they are filling out each section. I would like to add a description line to the ones that do not have any (I changed the descriptions of the pre-existing ones with LocoTranslate). Have you done this before?

I have only the code snippet to put the description for tags and for the listing description on the front end edit listing for now. Would you like these?

Sure I’d like to see what that looks like, thanks!

Add description to tags in the add listing field:

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if(isset($form['fields']['tags'])){
		  $form['fields']['tags']['description'] = 'Add your custom text here';
		}

		return $form;
	},
	1000
);

Add description to the listing description in add listings:

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		$form['fields']['description']['description'] = 'add your custom text here';

		return $form;
	},
	1000
);

Let me know if you figure out how to add for the rest of them. Good to have them in case we need them.

Yea I’ve used loco translate also to change some words around. I also have found code snippets for adding description on price field, request field, offers field i believe. Most i I have found searching through this forum or the old forum, or the code snippet list that Hivepress maintains.

3 Likes

I’ve figured out how to do it for each category! Use the code you provided and change only the bolded part depending on the field. You can find the field by using View > Developer > View Source option in Chrome and search the source code for the field based on the word you see on the front end.

add_filter(
‘hivepress/v1/forms/listing_update’,
function( $form ) {
$form[‘fields’][‘description’][‘description’] = ‘add your custom text here’;

  return $form;

},
1000
);

1 Like

For sure! Here it is. Just use command+F (search function) to search the words in the source code. So for instance, I just searched ‘extras’ to see how it was used.

// Extras description
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		$form['fields']['price_extras']['description'] = 'Custom description here.';

		return $form;
	},
	1000
);
1 Like

Got it. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.