From 4e6b3824c265fceb7ec202c04e0ce43d076a37fc Mon Sep 17 00:00:00 2001 From: Jamie Blacker Date: Wed, 29 Jun 2016 21:34:37 +0100 Subject: [PATCH] Allow disabling the title attribute Passing title: false as an attribute to the htmlLink method will suppress the output of a title attribute. See for why: https://silktide.com/i-thought-title-text-improved-accessibility-i-was-wrong/ --- fruitlinkit/models/FruitLinkIt_LinkModel.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fruitlinkit/models/FruitLinkIt_LinkModel.php b/fruitlinkit/models/FruitLinkIt_LinkModel.php index 5ecde18..ac82c14 100644 --- a/fruitlinkit/models/FruitLinkIt_LinkModel.php +++ b/fruitlinkit/models/FruitLinkIt_LinkModel.php @@ -62,7 +62,10 @@ public function getHtmlLink($attributes = false) { foreach ($attributes as $attr => $value) { - $htmlLink .= ' '.$attr.'="'.$value.'"'; + if($value !== false) + { + $htmlLink .= ' '.$attr.'="'.$value.'"'; + } } }