Add vendor profile link to the account menu

Hi there!

I noticed there’s a new “View profile” link inside the vendor account settings. However, it’s hidden so barely anyone will find it.

Is there a shortcode or something to add it anywhere on the website? If not, is it possible to add that link to the menu inside the account page? I added a screenshot, the arrow marks the spot where the link should be. Preferably the link should be named “Profile”.

Thank you for your efforts!

I got a message that you edited my original post but no reply yet? Has something went wrong?

Hi,
Please try this PHP snippet:

add_filter(
	'hivepress/v1/menus/user_account',
	function ( $menu ) {
		if ( is_user_logged_in() ) {
			$vendor_id = HivePress\Models\Vendor::query()->filter(
				[
					'user' => get_current_user_id(),
				]
			)->get_first_id();

			if ( $vendor_id ) {
				$menu['items']['vendor_view'] = [
					'label'  => 'Vendor Profile',
					'url'    => hivepress()->router->get_url( 'vendor_view_page', [ 'vendor_id' => $vendor_id ] ),
					'_order' => 123,
				];
			}
		}

		return $menu;
	},
	1000
);

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