[wp-trac] [WordPress Trac] #62763: get_calendar(): IDs may be duplicated
WordPress Trac
noreply at wordpress.org
Thu Jan 2 01:34:05 UTC 2025
#62763: get_calendar(): IDs may be duplicated
--------------------------+-----------------------------
Reporter: wildworks | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
I discovered this while looking into the following Gutenberg issue:
https://github.com/WordPress/gutenberg/issues/68451
The `get_calendar()` function applies the following two IDs to the
generated HTML:
- table element: `wp-calendar`
- Today's date cell: `today`
These IDs cannot be changed, so the IDs will be duplicated if multiple
calendars are output.
Using the `wp_unique_id()` function will help us avoid duplicate IDs, but
there are themes or plugins that rely on existing IDs, so we may need to
use a different approach.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62763>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list