I have constructed a function that return taxonomy post term array by using (wp_get_post_terms function) in wordpress. I added this function to the functions.php file of my custom theme and then define shortcode with add_shortcode() function for showing parameter name of taxonomy. My problem is that this shortcode not working with array function. (it’s worked perfectly on outside of the function but on function ????)
Any help, please?
$term_list = wp_get_post_terms($post->ID, ‘city’, array(“fields” =>
return $term_list->name ;
add_shortcode( ‘post_industry’, ‘post_industry’ );