Customize: Exclude widget ID attributes from search.

Having search terms match the ID attributes leads to confusing results, specifically when the admin interface is set to a language other than English.

Follow-up to [27650].

Props afercia, dlh, noisysocks.
Fixes #46456.

git-svn-id: https://develop.svn.wordpress.org/trunk@49586 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-11-12 22:03:36 +00:00
parent e9e2e6fc2c
commit d6fa3df420

View File

@@ -98,7 +98,7 @@
match = new RegExp( '^(?=.*' + term + ').+', 'i' );
this.each( function ( data ) {
haystack = [ data.get( 'name' ), data.get( 'id' ), data.get( 'description' ) ].join( ' ' );
haystack = [ data.get( 'name' ), data.get( 'description' ) ].join( ' ' );
data.set( 'search_matched', match.test( haystack ) );
} );
}