Make WordPress Core

Changeset 53089


Ignore:
Timestamp:
04/07/2022 04:04:31 AM (5 years ago)
Author:
peterwilsoncc
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/tags-suggest.js

    r49710 r53089  
    6464                                        action: 'ajax-tag-search',
    6565                                        tax: taxonomy,
    66                                         q: term
     66                                        q: term,
     67                                        number: 20
    6768                                } ).always( function() {
    6869                                        $element.removeClass( 'ui-autocomplete-loading' ); // UI fails to remove this sometimes?
  • trunk/src/wp-admin/includes/ajax-actions.php

    r53088 r53089  
    159159                        'fields'     => 'names',
    160160                        'hide_empty' => false,
     161                        'number'     => isset( $_GET['number'] ) ? (int) $_GET['number'] : 0,
    161162                )
    162163        );
Note: See TracChangeset for help on using the changeset viewer.