Support

Account

Home Forums General Issues Get terms of relationship field Reply To: Get terms of relationship field

  • This should work and do what I want, but it does not work. Someone to help ?? I do not know where I’m going wrong.

    $args = array(
    	'taxonomy' => 'custom_taxonomy',
    	'orderby' => 'name',
    	'order' => 'ASC',
    	'meta_query' => array(
    		array(
    			'key' => 'my_custom_field', // name of custom field
    			'value' => "{$post_id}", // matches exactly "123", not just 123. This prevents a match for "1234"
    			'compare' => 'LIKE'
    		)
    	);
    	$atv = get_terms($args);
    	var_dump($atv)