Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #42770, comment 2


Ignore:
Timestamp:
12/03/2017 04:50:34 PM (8 years ago)
Author:
slushman
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #42770, comment 2

    v1 v2  
     1Hey @MacLeroy, thanks for posting your first ticket!
     2
     3Are you trying to save a link with an onclick attribute, like this?
     4
     5<a href="http://www.example.com" onclick="trackOutboundLink('http://www.example.com'); return false;">Check out example.com</a>
     6
     7
     8The Custom HTML widget sanitizes the submitted HTML by checking against a list of allowed HTML tags and their allowed attributes. By default, the onclick attribute isn't allowed for the A tag, so the code linter is warning you that it found invalid code, like @1naveengiri mentioned above.
     9
     10However, if you're an admin or have the capability of posting unfiltered HTML, you should be able to save a link like the one above. I was able to save that example link above in a Custom HTML widget.
     11
     12Are you an admin on this site you're working on?
     13Do you have any other plugins installed and activated?
     14Are you using one of default themes?
     15
     16I'm wondering if something else is conflicting and causing the error you're seeing.
     17
     18Thanks for contributing to WordPress!