SOLVED: Wanting to remove some attributes from Link controls

I do not need some attributes in Link controls. I want to remove the “rel”, target", “aria-label” and “title”

Screenshot 2022-06-22 at 8.44.35 AM

I am using the following code

$this->controls['redirectLink'] = [
			'tab' 		=> 'content',
			'type' 		=> 'link',
			'label'		=> esc_html__( 'Redirect URL', 'prefix' ),
			'exclude' 	=> [
				'title',
				'ariaLabel',
				'newTab',
				'rel'
			],
			'required' 	=> [ 'ajaxATC', '=', true ]
		];

But above code is not working.

Hi Chinmoy,

Sorry, that won’t work right now as the exclude control properly only takes the linkType options into account (e.g. lightboxImage, lightboxVideo, etc.). I’ll make sure that all link sub controls like title, rel, etc. are covered in Bricks 1.5. Hope this helps.

Best,
Thomas

5 Likes

That sounds good. Sometimes we do not need all options for the link. So excluding logic would be the best option.

2 Likes

Marking this as “solved” as the exclude (array) has been added to the link control in 1.5-rc. I’ve updated the code example as well: Link Control – Bricks Academy

1 Like