WordPress.org

Make WordPress Core

Opened 10 months ago

Last modified 9 months ago

#24604 new defect (bug)

replace id atribute with class for calendar_wrap value of the Calendar Widget

Reported by: alexvorn2 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

I think the echo '<div id="calendar_wrap">'; should be replaced with echo '<div class="calendar_wrap">'; because having the same id on the pages is not valid, if we will have two calendars on the page.

Attachments (1)

calendar_wrap.diff (500 bytes) - added by transom 9 months ago.
Changes id="calendar_wrap" to class="calendar_wrap" in default widget

Download all attachments as: .zip

Change History (5)

transom9 months ago

Changes id="calendar_wrap" to class="calendar_wrap" in default widget

comment:2 transom9 months ago

The issues in #16539 are somewhat applicable in that it is possible that third-party themes are looking for the #calendar_wrap div. That said, the core themes do not address that #calendar_wrap. This change is not as critical given that the #calendar_wrap is not attached to an input field (or label) and unlikely to negatively impact screen readers.

The benefit is semantically correct markup. The negative is that a third-party theme may be looking for the #calendar_wrap

comment:3 transom9 months ago

  • Keywords has-patch added; needs-patch removed

comment:4 nacin9 months ago

Normally we'd try to print #calendar_wrap on the first instance, and hide it from all subsequent instances. That way it's backwards compatible at least for a primary use case (one calendar, styled by a theme).

I think when adding a class name (which we'd do for all instances), we can probably come up with a better name in the process.

Note: See TracTickets for help on using tickets.