I am trying to use wp_list_pluck to return an array of taxonomy names from get_terms. I'm not sure what I'm doing wrong, but this only echo's out "Array":
$terms = get_terms(array( 'taxonomy' => 'state', 'hide_empty' => false, )); $term_ids = wp_list_pluck( $terms, 'name' ); echo $term_ids;
Do you know how I can echo out an array of taxonomy names?
Basically I'm using jQuery Autocomplete and would like to get my taxonomy names listed as suggestions to search for:
var availableTags = <?php echo json_encode( $term_ids ) ?>
Perhaps there is possibly a better way to achieve what I am trying to do? Thank-you.