Skip to:
Content

BuddyPress.org

Opened 5 years ago

#7696 new defect (bug)

Widget markup should not have hardcoded `id` param

Reported by: boonebgorges's profile boonebgorges Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Core Keywords: good-first-bug needs-patch
Cc:

Description

I've just noticed that at least one of our widget classes has hardcoded id attributes in the markup generated by widget(). This shouldn't happen. We should use $this->id to concatenate id attributes, in case someone wants to have more than one instance on a page. See eg https://buddypress.trac.wordpress.org/browser/tags/2.9.3/src/bp-groups/classes/class-bp-groups-widget.php?marks=120,130#L118 The rest of our widgets could use an audit for this.

We can minimize backward compatibility breaks by keeping the currently hardcoded IDs for the first instance on a page.

Our JS may also need a review for this - I'm not sure whether it references widget IDs or classes, but it should only use selectors.

Change History (0)

Note: See TracTickets for help on using tickets.