Editor: Limit display of tags on classic editor.

On the classic editor, limit the search of tags and non-hierarchical taxonomies to twenty results. This in turn prevents an unbounded database query via an AJAX request.

Props pikamander2, costdev, azouamauriac, audrasjb.
Fixes #55052.



git-svn-id: https://develop.svn.wordpress.org/trunk@53089 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson
2022-04-07 04:04:31 +00:00
parent 7f94f99062
commit 86c6fb2915
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -63,7 +63,8 @@
$.get( window.ajaxurl, {
action: 'ajax-tag-search',
tax: taxonomy,
q: term
q: term,
number: 20
} ).always( function() {
$element.removeClass( 'ui-autocomplete-loading' ); // UI fails to remove this sometimes?
} ).done( function( data ) {
+1
View File
@@ -158,6 +158,7 @@ function wp_ajax_ajax_tag_search() {
'name__like' => $s,
'fields' => 'names',
'hide_empty' => false,
'number' => isset( $_GET['number'] ) ? (int) $_GET['number'] : 0,
)
);