How to display a custom "Menu" tab in the listing page?

Hi HivePress team,

I’m using the RentalHive theme and I’ve added a custom text field named menu (rich text) using the Attributes feature. It displays well in the back-end, and the value is saved correctly.

However, I want to display this field as a separate tab named “Menu” (next to “Description”, “Location”, “Reviews”) on the listing detail page.

Can you help me with a PHP snippet to:

  1. Add a custom tab if the menu field is filled.
  2. Display the content of the menu field (formatted with HTML) inside that tab.

Thanks in advance for your support!

Hi,

Please use this PHP snippet:

add_filter(
	'hivepress/v1/menus/listing_manage',
	function( $menu ) {
		$menu['items']['custom_name_here'] = [
			'label'  => 'custom label here',
			'url'    => 'custom url here',
			'_order' => 123,
		];

		return $menu;
	}
);

I hope it helps