mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-04 12:01:40 +00:00
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:
@@ -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 ) {
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user