Hello,
Please add this code to functions.php of the child theme:
if ( ! function_exists( 'woodmart_get_taxonomies_by_query_autocomplete' ) ) {
/**
* Autocomplete by taxonomies.
*
* @since 1.0.0
*/
function woodmart_get_taxonomies_by_query_autocomplete() {
$output = array();
$args = array(
'number' => 5,
'taxonomy' => $_POST['value'], // phpcs:ignore
'search' => $_POST['params']['term'], // phpcs:ignore
'hide_empty' => false,
);
$terms = get_terms( $args );
if ( count( $terms ) > 0 ) { // phpcs:ignore
foreach ( $terms as $term ) {
$output[] = array(
'id' => $term->term_id,
'text' => $term->name,
);
}
}
echo wp_json_encode( $output );
die();
}
add_action( 'wp_ajax_woodmart_get_taxonomies_by_query_autocomplete', 'woodmart_get_taxonomies_by_query_autocomplete' );
add_action( 'wp_ajax_nopriv_woodmart_get_taxonomies_by_query_autocomplete', 'woodmart_get_taxonomies_by_query_autocomplete' );
}
We will fix that and ampersand in the nearest update.
Best Regards