Add audio file to post using custom term meta field as link [closed]

I figured it out!

Using this code I was able to use my custom meta field as the link in the audio shortcode.

First I created a function in functions.php:

function audio_link() {
    $terms = get_the_terms($post->ID, 'taxonomy-name');
    $result = "";
    if (is_array($terms) || is_object($terms)){
    foreach ($terms as $term) {
    $term_id = $term->term_id;
    $result .= get_term_meta( $term_id, 
    'term-meta-field-name', true );
        }
    }
        return $result;
    }

Then I inserted the function into the shortcode like this:

<?php echo do_shortcode(''. audio_link() .'');?>

Hope this helps anyone else with this problem!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)