WordPress Podpress Plugin – Exchanges the default download icon

Exchanges the default download icon of a certain media file type, not quite working but if you can get it to work let me know. Copy inside your functions.php file

<?php
/*
Plugin Name: podPress media file icon filter
Plugin URI:
Description: exchanges the default download icon of a certain media file type
Author: ntm
Version: 1.0
Author URI:
*/
add_filter('podpress_downloadlinks', 'customize_podpress_downloadlinks');
function customize_podpress_downloadlinks($podPressDownloadlinks) {
// If the current download links code is related to a mp3 file then it contains the phrase "podPress_downloadlinks_audio_mp3". Start the actions only in that case
if (FALSE !== stripos($podPressDownloadlinks, 'podPress_downloadlinks_audio_mp3')) {
$default_image_url = plugins_url('podpress').'/images/audio_mp3_button.png';
$custom_image_url = plugins_url('audio_mp3_button.png', __FILE__); // in case the new button file is in the same folder as this plugin
$podPressDownloadlinks = str_replace($default_image_url, $custom_image_url, $podPressDownloadlinks);
$podPressDownloadlinks .= "\n".''."\n";
}
return $podPressDownloadlinks;
}
?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s