Skip to content

Commit 4b34765

Browse files
committed
Customize: Prevent JS error in Links widget when selective refresh is enabled
This prevents erroneously replacing the `data-customize-partial-id` when only the `id` attribute should be replaced. Props dlh, costdev, nikeo, greenshady. Fixes #39451. git-svn-id: https://develop.svn.wordpress.org/trunk@54125 602fd350-edb4-49c9-b593-d223f7449a82
1 parent db0290b commit 4b34765

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/widgets/class-wp-widget-links.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function widget( $args, $instance ) {
4848
$order = 'rating' === $orderby ? 'DESC' : 'ASC';
4949
$limit = isset( $instance['limit'] ) ? $instance['limit'] : -1;
5050

51-
$before_widget = preg_replace( '/id="[^"]*"/', 'id="%id"', $args['before_widget'] );
51+
$before_widget = preg_replace( '/ id="[^"]*"/', ' id="%id"', $args['before_widget'] );
5252

5353
$widget_links_args = array(
5454
'title_before' => $args['before_title'],

0 commit comments

Comments
 (0)