[wp-trac] [WordPress Trac] #39451: Javascript error when link_manager_enabled ( WP_Widget_Links) and theme supports customize-selective-refresh-widgets

WordPress Trac noreply at wordpress.org
Sun Sep 11 21:31:38 UTC 2022


#39451: Javascript error when link_manager_enabled ( WP_Widget_Links) and theme
supports customize-selective-refresh-widgets
------------------------------+--------------------------
 Reporter:  nikeo             |       Owner:  westonruter
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  6.1
Component:  Customize         |     Version:  4.5
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:  javascript
------------------------------+--------------------------
Changes (by westonruter):

 * keywords:  has-patch needs-testing => has-patch commit
 * owner:  (none) => westonruter
 * status:  new => accepted


Comment:

 The `before_widget` string being replaced:

 {{{
 <div  data-customize-partial-id="widget[links-2]" data-customize-partial-
 type="widget" data-customize-partial-placement-
 context="{"sidebar_id":"sidebar-1","sidebar_instance_number":1}"
 data-customize-widget-id="links-2" class="widget widget_links"><div class
 ="widget-content">
 }}}

 Difference in `$before_widget` before/after:

 {{{#!diff
 - <div  data-customize-partial-id="%id" data-customize-partial-
 type="widget" data-customize-partial-placement-
 context="{"sidebar_id":"sidebar-1","sidebar_instance_number":1}"
 data-customize-widget-id="%id" class="widget widget_links"><div class
 ="widget-content">
 + <div  data-customize-partial-id="widget[links-2]" data-customize-
 partial-type="widget" data-customize-partial-placement-
 context="{"sidebar_id":"sidebar-1","sidebar_instance_number":1}"
 data-customize-widget-id="links-2" class="widget widget_links"><div class
 ="widget-content">
 }}}

 The `preg_replace()` in question here comes from WordPress 2.8 in [10795]
 to fix #9349, which is all a part of introducing `WP_Widget`. The `%id`
 string appears to be part of how `wp_list_bookmarks()` does its thing.

 The patch fixes the error for me still.

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


More information about the wp-trac mailing list