From 49ace608dca45db366cb5f7f3af0201b48e828cb Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 26 Jul 2022 13:23:14 +0000 Subject: [PATCH] Taxonomy: Allow filtering Ajax term search results in quick edit. This changeset introduces the `ajax_term_search_results` hook which can be used to filter the term search results returned by the AJAX term query. Props grandeljay, costdev, ironprogrammer, audrasjb, SergeyBiryukov. Fixes #55606. Built from https://develop.svn.wordpress.org/trunk@53781 git-svn-id: http://core.svn.wordpress.org/trunk@53340 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 11 +++++++++++ wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 49276b4bd0..f69892ba7e 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -162,6 +162,17 @@ function wp_ajax_ajax_tag_search() { ) ); + /** + * Filters the Ajax term search results. + * + * @since 6.1.0 + * + * @param string[] $results Array of term names. + * @param WP_Taxonomy $tax The taxonomy object. + * @param string $s The search term. + */ + $results = apply_filters( 'ajax_term_search_results', $results, $tax, $s ); + echo implode( "\n", $results ); wp_die(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0cd17d94f7..4c7043462e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53780'; +$wp_version = '6.1-alpha-53781'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.