简体   繁体   中英

Encode uploaded mp3 files in WordPress

Is there a way to encode every MP3 file I've attatched in my WordPress site? This is how the code looks when you go to source:

<ol class='songs'><li><a href='http://localhost/wordpress/wp-content/uploads/2011/10/f1678576.mp3' title='Song Title'>Artist - Song</a></li></ol>

PHP code:

if ($attachments) {
        echo "<ol class='songs'>";
        foreach ($attachments as $attachment) {
        echo "<li>";
            echo wp_get_attachment_link($attachment->ID);
            echo "</li>";
        }
        echo "</ol>";
    }

I saw WPaudio but don't know how to implement it. This is how the WPaudio code looks:

<pre><code><script type='text/javascript'>_wpaudio.enc['wpaudio-5019e1ff1c9da'] = '\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0075\u0072\u006c\u002e\u0074\u006f\u002f\u0079\u006f\u0075\u0072\u002e\u006d\u0070\u0033';</script><a id='wpaudio-5019e1ff1c9da' class='wpaudio wpaudio-enc' href='#'>Artist - Song</a></code></pre>

If you have any suggestions please feel free to express. Thank you.

WPAudio looks fairly straightforward to install if this is how you want to go about things ... http://wpaudio.com/#install ... at the end of the day you're going to spend a lot of effort hiding a file name by encoding it when you could use another player.

If you're going to be that paranoid might as well use a service like SoundCloud http://soundcloud.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM