Community Documentation

Custom code

Last updated July 19, 2009. Created by jdelaune on July 19, 2009.
Log in to edit this page.

<?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');
?>

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x
Audience
Developers and coders
Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here