I'm almost finished the re-skin and development of a customer site, and one of the final items I need to build support for is the audio shortcode they're using. The problem I'm having is that the audio shortcode does not use an attribute, but has an attribute value:
[audio=http://1234.domain.com/wp-content/uploads/audiofile.mp3]
How do I render this on the page?
I would use the following function, but there is no attribute in the above shortcode:
function audio_shortcode($atts) {
$a = shortcode_atts( array(
'uri' => ''
), $atts);
return '<audio controls><source src="' . $a['uri'] . '" type="audio/mpeg"></audio>';
}
add_shortcode('mp3audio', 'audio_shortcode');
I reviewed the documentation here: https://codex.wordpress.org/Shortcode_API but it doesn't have any examples here [scode="value"].
Any suggestions on how to proceed?