Join our new community forum for support & discussion

Join Now

Home Support Themes ExpertHive User Account

User Account

  • Author
    Posts
  • maurente

    How can we edit what the vendor sees in the user account page?

    yevhen developer

    If you mean account page menu then you can try changing menu items via the hivepress/v1/menus/user_account filter like in this topic https://hivepress.io/support/search/menus%2Fuser_account/

    But if you want to make changes only for vendors then code needs additional condition if(current_user_can('edit_posts')) {
    For example, I add this condition to code from topic which is provided above

    add_filter(
    	'hivepress/v1/menus/user_account',
    	function( $menu ) {
    	// Here is this condition to make changes only for vendors.
    	if(current_user_can('edit_posts')) {
       		// To add some menu items.
    		$menu['items']['custom_item_name'] = [
    			'label'  => 'Custom Item',
    			'url'    => 'some url',
    			'_order' => 123,
    		];
    
    		// To remove some menu items.  For example, 'Listings' item
    		unset($menu['items']['listings_edit']);
    	}
    		
    	return $menu;
    	}
    );
Viewing 2 posts - 1 through 2 (of 2 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.