I was able to echo out all terms belonging to a custom taxonomy using the code below:
$args = array('post_type' => 'my_post_type','number' => '999');
$terms = get_terms( 'my_taxo',
[
'hide_empty' => true,
'orderby' => 'wpse_last_word',
] , $args );
foreach ( $terms as $term ) {
echo '' . $term->name . '';
}
This code provides the results I want on my localhost (xampp). Basically, it outputs all of the terms assigned to a particular post. But when I upload the code to a live server, the code no longer works as expected. Instead, it shows all the terms without filtering them. I even updates the PHP version on my live server match to the local server; still no luck.
Can anyone point out the issue on my code.