Experthive descriptions in the listing fields

Hello Team! Can i add descriptions to the Category and Availabilty selection fields when the vendors post their listings?

These ones:

  1. Is there a way i can hide some of these booking options:

Thanks again!

  1. Please try this PHP snippet
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		
		// Add description for Title field.
		if(isset($form['fields']['title'])){
		  $form['fields']['title']['description'] = 'custom text here';
		}
		
		// Add description for Availability field.
		if(isset($form['fields']['availability'])){
		  $form['fields']['availability']['description'] = 'custom text here';
		}

		return $form;
	},
	1000
);
  1. Please try this PHP snippet
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		
		// Remove Booking Offset field.
		if(isset($form['fields']['booking_offset'])){
			unset( $form['fields']['booking_offset'] );
		}
		
		// Remove Booking Window field.
		if(isset($form['fields']['booking_window'])){
			unset( $form['fields']['booking_window'] );
		}
		
		// Remove Booking Requests field.
		if(isset($form['fields']['booking_moderated'])){
			unset( $form['fields']['booking_moderated'] );
		}
		
		// Remove Minimum Booking duration field.
		if(isset($form['fields']['booking_min_length'])){
			unset( $form['fields']['booking_min_length'] );
		}
		
		// Remove Maximum Booking duration field.
		if(isset($form['fields']['booking_max_length'])){
			unset( $form['fields']['booking_max_length'] );
		}
		
		return $form;
	},
	1000
);

Hello Yheven, the description for the Title field was already added, i need to add a description in the Category field. I added it but i doesn’t work :frowning:

The availability one works perfectly, thanks!!

Sorry for the inconvenience, please try this PHP snippet to add description for Category field

add_filter(
	'hivepress/v1/forms/listing_submit',
	function( $form ) {
		
		// Add description for Category field.
		if(isset($form['fields']['categories'])){
		  $form['fields']['categories']['description'] = 'custom text here';
		}

		return $form;
	},
	1000
);

Hello Yheven, thanks for the reply. I want to hide the category selector in the Add Description page where you add the details of the announce.

This is the part a i want to hide:

Unfortunately, there is no possibility to hide the category field as it is required. But as another solution, you can try this PHP snippet Enable the Select Category page (deprecated) in the Add Listing process #hivepress #listings · GitHub which will show categories as blocks on the separate page and there will not be a category field on the Add Details page

Thank for the reply. Before the update we first selected the category of the announce in a separated page (it still that way) then we continue to the Add Details, but now appears that category field in this page and that din’t appears before, plus and the end of the this was an arrow to go back to the Category selection page. I want it that way. That is not possible?

Before the update the page was like this:

Thanks for the help!

And more question. Is there a snippet to re-order the elements in the Dashboard?

These elements in particular:

  1. Unfortunately, there is no simple solution for it, it requires advanced customization as the button to change the selected category was deleted in the previous versions

  2. If you mean the user account menu then please try this PHP snippet. The current snippet will move the Dashboard menu item but it is possible to use this code snippet for other menu items too

add_filter(
	'hivepress/v1/menus/user_account',
	function( $menu ) {
		if(isset($menu['items']['vendor_dashboard'])){
			$menu['items']['vendor_dashboard']['_order'] = 50;
		}
		
		return $menu;
	},
	1000
);

Thanks a lot Yehen, i tried to move the rest of the items but it didn’t work. Can you help me to reorder the items in this order:

1- dashboard
2- account settings
3- submit-listing
4- listings
5- disconnect

If you’re familiar with PHP basics please try to output the items this way:

add_filter(
	'hivepress/v1/menus/user_account',
	function( $menu ) {
		var_dump($menu['items']);
		die();

		return $menu;
	},
	1000
);

This will output all the menu item keys on the front-end, so you’ll be able to use them with a sample snippet above to re-order or unset any items.

Hope this helps.

Thanks Yevhen that works perfectly. With that snipet i could find the keys of each item and then applied them in the snippet above.

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