Hey, sorry for the delayed response, for some reason my notifications on many discussions has got turned off.
I found the example code that I used. Different taxonomies but it is working.
function get_current_taxonomy( $field ) {
global $post;
if ('publication' === $post->post_type) {
$field['taxonomy'] = 'publication-type';
}
if ('post' === $post->post_type) {
$field['taxonomy'] = 'category';
}
return $field;
}
add_filter('acf/load_field/key=field_558aa7b9f6168', 'get_current_taxonomy');