Skip to content

Commit 38e2c0c

Browse files
committed
Remove the title attribute from the link example
Accessibility improvement in the example. Replaced the title with the class attribute.
1 parent e70a1bd commit 38e2c0c

File tree

1 file changed

+2
-2
lines changed
  • wordpress-coding-standards

1 file changed

+2
-2
lines changed

wordpress-coding-standards/php.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ See also: [PHP Inline Documentation Standards](https://developer.wordpress.org/c
1313
Use single and double quotes when appropriate. If you're not evaluating anything in the string, use single quotes. You should almost never have to escape quotes in a string, because you can just alternate your quoting style, like so:
1414

1515
```php
16-
echo '<a href="/static/link" title="Yeah yeah!">Link name</a>';
17-
echo "<a href='$link' title='$linktitle'>$linkname</a>";
16+
echo '<a href="/static/link" class="button button-primary">Link name</a>';
17+
echo "<a href='$link' class='$classname'>$linkname</a>";
1818
```
1919

2020
Text that goes into attributes should be run through `esc_attr()` so that single or double quotes do not end the attribute value and invalidate the HTML and cause a security issue. See [Data Validation](https://developer.wordpress.org/plugins/security/data-validation/) in the Plugin Handbook for further details.

0 commit comments

Comments
 (0)