[Plugin: Audio Player] insert_audio_player doesn't work with rss
-
I’ve been working on a site with a ton of audio content that we’ve setup using the ‘insert_audio_player’ function, like so:
// if there is an audio file, show player if (function_exists("insert_audio_player")) { $audiofile = get_post_meta($post->ID, audio, true); $author = get_the_author(); $podcasttitle = get_the_title($post->ID); // do we have one? if($audiofile) { insert_audio_player("[audio:".$audiofile."|titles=".$podcasttitle."|artists=".$author."|width=100%]"); ?><a href="https://www.mysite.com/audio/<? echo $audiofile; ?>">Click to Download the Audio File</a><? } }
Each audio file is setup as a custom field called ‘audio’ which the above then uses to render the player etc.
The problem (which is a major one) is that using the ‘insert_audio_player()’ function doesn’t behave the same as using the [audio: file.mp3] shortcode and the audio content is completely ignored for things like podcasts & other rss content.
I have been fighting with this for waaay too long now and finally did some testing of some simple [audio: file.mp3] short codes added directly into post, and noticed that these shortcode links behave completely differently than using the include_audio_player() function does.
Specifically, if you use [audio: myfile.mp3] directly in a post, when saving the post, there is a new custom field called ‘enclosures’ added to the post that contains the info required for an rss feed, ie byte size & entry name
So, my question is: how do I fix the ‘include_audio_player()’ function so that it properly adds the ‘enclosure’ custom field for my rss feeds?
Thanx in advance,
- The topic ‘[Plugin: Audio Player] insert_audio_player doesn't work with rss’ is closed to new replies.