Opened 16 years ago
Closed 14 years ago
#16713 closed defect (bug) (duplicate)
Wordpress removes title attribute from images
| Reported by: | ukdmbfan | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Formatting | Version: | 3.1 |
| Severity: | normal | Keywords: | dev-feedback has-patch |
| Cc: | Focuses: |
Description
For everyone apart from super-admin users, WordPress will remove a title attribute defined in an <img> tag. This is because it's not defined in the /wp-includes/kses.php file as being a valid attribute for <img>.
It may be that WordPress doesn't consider title to be a valid attribute (even though it's a standard W3C HTML attribute) which is fine, but WordPress also provides an input box for the title in the image editing popup, which adds the title attribute to the <img> tag, which then doesn't save for anyone other than a super-admin user (even though all users can save a value in that box).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch adds
titleto allowedimgattributes.However, the
titleattribute is allowed anywhere in HTML. Is there any reason why we can't tell kses to allow it on all elements? I can't see any security reason not to let authors use title attributes wherever they like. Something like 16713.2 maybe.