Custom code
Last updated on
30 April 2025
<?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');
?>
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion