Taxonomy: Use REST API for ajax tag search.

Deprecate wp_ajax_ajax_tag_search and switch to using the REST API when searching tags in the tags meta box.

Props nacin, chriscct7, afercia, swissspidy, jnylen0, rmccue, ryelle.
Fixes #38922.



git-svn-id: https://develop.svn.wordpress.org/trunk@42614 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein
2018-01-30 00:16:37 +00:00
parent 07e4b7565e
commit 04b0a0f77c
4 changed files with 76 additions and 88 deletions

View File

@@ -726,6 +726,17 @@ function wp_default_scripts( &$scripts ) {
'termSelected' => __( 'Term selected.' ),
'termAdded' => __( 'Term added.' ),
'termRemoved' => __( 'Term removed.' ),
'restURL' => rest_url( '/wp/v2/tags' ),
/**
* Filters the minimum number of characters required to fire a tag search via Ajax.
*
* Previous to 4.8.0, this filter passed taxonomy and search context parameters.
* @since 4.0.0
*
* @param int $characters The minimum number of characters required. Default 2.
*/
'minChars' => (int) apply_filters( 'term_search_min_chars', 2 ),
)
);