Make WordPress Core

Opened 5 months ago

Last modified 2 months ago

#42849 new feature request

Custom HTML Widget: Allow user to be able to bypass lint errors to save

Reported by: skoen Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9
Component: Widgets Keywords: needs-patch
Focuses: Cc:


In the custom HTML widget I have some div ids that are the same, and for some reason I can't save the edited widget after updating to 4.9. I would like an ignore button to be able to save the content inside a widget, especially the custom HTML widget. I don't want WordPress' brand new HTML checker feature to override code that is working completely fine.

Would it be possible to do that, or make it so that you can at least checkmark something to be able to save the widget.

The error it is bugging me about is this:

<div id="widget4"><i class="fa fa-arrow-circle-right"></i>
   <a href="http://hamarradioen.no/om-oss/"><p>Dette er HamarRadioen</p></a></div>

<div id="widget4"><i class="fa fa-arrow-circle-right"></i>
   <a href="http://hamarradioen.no/om-oss/ansatte/"><p>Ansatte</p></a></div>

Because I have two or more widgets using the same formatting it actually wants me to change them, and in that case break the formatting just to please itself. I have made websites for over 20 years, I don't need a WordPress feature «for dummies» to tell me how to write my HTML code.

Attachments (1)

42849.diff (3.6 KB) - added by iCaleb 5 months ago.
Incomplete patch for 42849

Download all attachments as: .zip

Change History (11)

#1 @westonruter
5 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.9.2

Yes, we added the ignore ability to Custom CSS in Customizer and the Theme/Plugin editor but we didn't add it to the Custom HTML widget yet.

#2 @iCaleb
5 months ago

Took a quick stab at this and got it working for the HTML widget outside of the Customizer. I don't know much about the api, but doing this within the wp.customize.Notification realm seems a bit difficult at the moment.

Uploading my diff, but it's definitely not ready. Might help whoever picks this up next :)

Couple of things needed of the top of my head:

1) Passing down onChangeLintingErrors doesn't feel right, but couldn't find a better way given the setup. 2) Interactions with setCustomValidity don't feel right either. 3) Of course needs to work on the Customizer side as well. 4) Just noticed the checkbox and label need id and for attributes.

5 months ago

Incomplete patch for 42849

This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.

4 months ago

#4 @westonruter
4 months ago

  • Summary changed from Ignore html «error» to Custom HTML Widget: Allow user to be able to bypass lint errors to save

#5 @westonruter
4 months ago

  • Version changed from 4.9.1 to 4.9

#6 @dd32
4 months ago

  • Milestone changed from 4.9.2 to 4.9.3

Bumping to 4.9.3 due to 4.9.2s release

This ticket was mentioned in Slack in #core by desrosj. View the logs.

4 months ago

#8 @desrosj
4 months ago

  • Milestone changed from 4.9.3 to 4.9.4

Punting to 4.9.4.

#9 @dd32
3 months ago

  • Milestone changed from 4.9.4 to 4.9.5

Bumping, 4.9.4 has been released.

#10 @westonruter
2 months ago

  • Milestone changed from 4.9.5 to Future Release

We can bring this back in when a patch is completed.

Note: See TracTickets for help on using tickets.