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!
Related Posts:
- How to add ‘class’ attribute into shortcode [audio]?
- Audio or playlist shortcode condition according to the amount of files on attachment page
- Using audio shortcode for .mp3 URLs with a query string
- Changing playlist shortcode thumbnail sizes?
- Passing attributes to shortcode dynamically
- Remove HTML content if attribute is not set / variable attributes
- Legacy Audio Shortcode
- Extending the Audio Shortcode
- Are .MP3 files with capital letter extensions allowed in [audio] shortcode?
- Shortcodes and a list of IDs?
- no content after shortcode
- Reloading a Mediaelement audio player
- How can I implement shortcode on click event
- Displaying audio player as preview in audio post in WP3.6
- Turning variable into a value set in shortcode
- Substite Category Slug in a Shortcode
- How to add data attributes to the wordpress audio shortcode
- Check if parent page has child page of certain slug
- Is the WP audio shortcode still relevant?
- Variable inside shortcode or shortcode inside shortcode
- Multiple values for one variable
- WordPress core playlist function not showing artist and album info
- Class variables in shortcodes
- Shortcode with multiple variables
- About redundant code when I use shortcode to output the HTML from a variable
- Complex Slider Shortcode Help
- Using _e() on text inside video tags prints that text, instead of only showing when html5 element is not supported
- Youtube shortcode
- Shortcode will not pass attribute through to my function [duplicate]
- How to edit blog page in wordpress? there is no place to put shortcode
- How to transform WordPress user role code to WP shortcode?
- Shortcode don’t work in custom option field, any solution?
- Can I use shortcodes in mail body
- Does short-code slow down my WordPress site?
- redirect if shortcode exists
- Position shortcode off [duplicate]
- Video Shortcode & Video Poster Question
- How to use a nested shortcode to render the value of an attribute in parent shortcode
- ob_get_clean(); doesn’t return $value in shortcode?
- Ordering get_terms with ACF not displaying all terms
- How to Get Shortcode in Excerpt to follow Document Flow
- Cant fix this Warning: Invalid argument supplied for foreach() in [closed]
- Different ID in every shortcode
- Which wordpress function is the caption shortcode linked to?
- Content between shortcodes
- Parsing a shortcode through an author meta textfield
- Adding YouTube button to TinyMCE editor
- How to find out what handler is registered to a shortcode
- Shortcode strips formatting and returns at content top
- do_shortcode within a shortcode
- tiny_mce_before_init preventing custom shortcode icon appearing
- Custom Fields – Boolean Display of True/False to Yes/No
- How to display NextGEN gallery in templates?
- Twitter bootstrap tabs
- jQuery Tabs in Shortcode API
- Build Clickable Link Using Multiple Attributes
- Using Shorcodes in Sharing Preview and Notifications Title from Post Title
- Echo Extra Shortcode HTML to wp_foot
- How can I use a plugin shortcode inside of a html form?
- Disable wpautop on Shortcode attributes
- remove shortcode pagination for specific url referrer
- Third-Party API – PHP Fatal Errors Paired with http_request_failed / cURL error 28
- If statement shortcode
- Shortcode PHP file for two conditions passed when do shortcode
- Using within a shortcode
- update_metadata() appends shortcode data for every page refresh
- How do I point bloginfo(‘stylesheet_directory’) to my parent theme?
- Gallery shortcode is empty but magically creates a gallery
- shortcode is not rendered
- nested shortcodes from different plugins. too complex? [duplicate]
- Impossible to display modification in shortcode code?
- Contact form code not working. Need help!
- Use Shortcode on Custom Page
- WordPress Database Error using $wpdb->get_results()
- Shortcode or Template Page
- Ajax callback and shortcode functionality
- Automatically add class-attribute to gallery?
- Shortcode works from functions.php but not from included file
- Duplicate short code duplicating some values only
- Shortcode for External HTML
- How to implement theme shortcodes in text outside of pages?
- Video Shortcode Only Returning a Link
- Loading shortcode stylesheet only when shortcode is in text widget [closed]
- Members only Passthrough
- How to add a nested shortcode into editor?
- Shortcode Attribute
- Can’t get default values to work with custom shortcode
- Can not get shortcode content in function
- Question about do_shortcode
- How create a shortcode with html
- Adding shortcode [closed]
- do_shortcode autommatic content generation
- Enclosing shortcodes create line breaks
- Add the results of a custom query into a do_shortcode
- Using $variable in shortcode
- Free Add to Cart Button on WooCommerce with Elementor – No Premium [closed]
- wordpress shortcode url decode non Latin character
- Shortcode return vs echo. Return messes with data URLs, echo does not
- How do I create a shortcode that returns a logged in users’ email?
- shortcode causes broken paragraph tags