Disable Vendor View Link on User Edit Settings Page

Hi team,

Please note that when the admin doest not want to display vendors on the front-end, users can still see the Vendor View Link on User Edit Settings Page. The link will redirect to home page in this case.

Is it a bug from your side ?

I am trying to disable this link with php snippets but it does not work. I don’t want to use CSS snippets.

add_filter( 
	'hivepress/v1/templates/alter_user_edit_settings_page', 
	function( $blocks, $template ) {
		return hivepress()->template->merge_blocks (
			$blocks,
			[
				'blocks' => [
					'user_update_form' => [
						'footer' => [
							'form_actions' => [
								'blocks' => [
									'vendor_view_link' => [
										'type' => 'content',
									],
								],
							],
						],
					],
				],
			]
		);
	
		return $blocks;
	},
	1000
);

Please could you tell me the correct way to do that ?

Thanks a lot !

Thank you for waiting. Please try this PHP code snippet instead as a temporary solution.

add_filter( 
	'hivepress/v1/templates/user_edit_settings_page/blocks', 
	function($blocks, $template){
		if(get_option('hp_vendor_enable_display')){
			return $blocks;
		}
		
		return hivepress()->template->merge_blocks(
			$blocks,
			[
				'user_update_form' => [
					'footer' => [
						'form_actions' => [
							'blocks' => [
								'vendor_view_link' => [
									'type'   => 'content',
								],
							],
						],
					],
				],
			]
		);
	}, 
	1000, 
	2 
);

Great, it works. Thank you so much !

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