Custom code

Last modified: July 19, 2009 - 16:38

<?php
/**
* Custom MP3 Player theme function.
*
* @param theme
*    Always set to 'mp3player'.
* @param player
*    The name of the player you want to use (default is 'Default').
* @param url
*    The URL to the mp3 file.
* @param album (optional)
*    The name of the album.
* @param artist (optional)
*    The name of the artist.
* @param description (optional)
*    A description of the mp3.
* @return A WordPress Audio Player instance.
*/
theme($theme, $player, $url, $album, $artist, $description);
?>

Two examples:

<?php
print theme('mp3player', 'Default', 'http://www.example.com/audiofile.mp3', 'An example file', 'John Smith', 'An optional description of the file');
?>

Or if your MP3 file has embedded ID3 data:

<?php
print theme('mp3player', 'Default', 'http://www.example.com/audiofile.mp3', NULL, NULL, 'An optional description of the file');
?>

 
 

Drupal is a registered trademark of Dries Buytaert.