[wp-trac] [WordPress Trac] #44098: Widget classes when custom widget class is namespaced

WordPress Trac noreply at wordpress.org
Mon May 24 09:50:47 UTC 2021


#44098: Widget classes when custom widget class is namespaced
-------------------------------------------------+-------------------------
 Reporter:  rogerlos                             |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.8
Component:  Widgets                              |     Version:  5.4.2
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing needs-dev-   |     Focuses:
  note                                           |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"50961" 50961]:
 {{{
 #!CommitTicketReference repository="" revision="50961"
 Widgets: Make sure `WP_Widget` constructor creates a correct `classname`
 value for a namespaced widget class.

 This reverts the changes to `id_base` from [50953] due to backward
 compatibility concerns, and instead focuses on the `id` and `class`
 attributes specifically.

 With this change, any backslashes in the `id` or `class` attributes for a
 namespaced widget class are converted to underscores, making it easier to
 style the output or target the widget with JavaScript.

 Follow-up to [50953].

 Fixes #44098.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44098#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list