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
This commit is contained in:
Weston Ruter 2022-09-11 21:57:09 +00:00
parent 6937c8d87e
commit aee27cf6c0
2 changed files with 2 additions and 2 deletions

View File

@ -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.

View File

@ -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'],