From aee27cf6c08d14815fdc335920e4381add632219 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 11 Sep 2022 21:57:09 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@54125 git-svn-id: http://core.svn.wordpress.org/trunk@53684 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/widgets/class-wp-widget-links.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index b661b68af5..4fde759d36 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54124'; +$wp_version = '6.1-alpha-54125'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-links.php b/wp-includes/widgets/class-wp-widget-links.php index e90b558ade..58ae2a7919 100644 --- a/wp-includes/widgets/class-wp-widget-links.php +++ b/wp-includes/widgets/class-wp-widget-links.php @@ -48,7 +48,7 @@ class WP_Widget_Links extends WP_Widget { $order = 'rating' === $orderby ? 'DESC' : 'ASC'; $limit = isset( $instance['limit'] ) ? $instance['limit'] : -1; - $before_widget = preg_replace( '/id="[^"]*"/', 'id="%id"', $args['before_widget'] ); + $before_widget = preg_replace( '/ id="[^"]*"/', ' id="%id"', $args['before_widget'] ); $widget_links_args = array( 'title_before' => $args['before_title'],