[buddypress-trac] [BuddyPress Trac] #7696: Widget markup should not have hardcoded `id` param

buddypress-trac noreply at wordpress.org
Mon Feb 19 15:18:52 UTC 2018

#7696: Widget markup should not have hardcoded `id` param
 Reporter:  boonebgorges  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Contributions
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:  good-first-bug needs-patch
 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
 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.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7696>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list