Modify media types "photo" to change default thumbnail issue

Hi guy, I tried to change the default thumb for ‘photo’ but it doesn’t work for me, I have no error, but the original is still in place. I only replace all ‘music’ words by ‘photo’ and point the image URL to the right place. Tks

@capobianco.brice - Why would you want a default thumb for a photo when it will show the original photo itself. Do you mean to change the default for audio and video?

Arf, it is a misunderstangin. I thought is was also to change the default album pictures. Isn't it ?

1 Like

@capobianco.brice - The album would take the thumbnail of the latest media uploaded to it incase you haven't set any album cover exclusively.

@joshuaabenazer I understand. For exemple, if you ONLY create onealbum in wich you upload some photo, it will take the latest pictures to use it as cover, but in this case, the default album "wall post" will not have any picture in it, and will display the default picture (polaroïd). I only want to change this one ;-)

Thanks

@capobianco.brice - You would need to use this filter -> rtmedia_allowed_types - http://rtcamp.com/rtmedia/docs/developer/rtmedia-hooks/rtmedia_allowed_types/ for that, and assign your image url to $allowed_types['photo']['thumbnail'].

Hi @joshuaabenazer, my original post was exactly on the page you've linked above. And my problem is still the same, nothing appened. I do not have any error. Will post some news here after updating all my plugins and wordpress core. Thanks

Hi there, still note works :/ hope I do it right :

    function custom_rtmedia_default_photo_thumb($allowed_types) {  
    $allowed_types['photo']['thumbnail'] = get_template_directory_uri() .'/_inc/images/avatar.jpg';  
    return $allowed_types;  
}  
add_filter('rtmedia_allowed_types', 'custom_rtmedia_default_photo_thumb');  

Thanks ;-)

@capobianco.brice - The above code should work actually. Where exactly are you placing the above code? Also have you tried echoing that url and checking if the image actually exists?

Hi @joshuaabenazer, I place this code in my custom.php file wich is include at the beginning of my functions.php file ;-) And yep, I'm sure this image exists cause it is my default image I use everywhere on my site (to overload Gravatar default picture for exemple). ++

@capobianco.brice - Looks like there is some issue with the filter. We are looking into it. Till then you could do the following.

global $rtmedia;  
$rtmedia->allowed_types[ 'photo' ][ 'thumbnail' ] = get_template_directory_uri() .'/_inc/images/avatar.jpg';  

Thanks @joshuaabenazer, You rox, it works now ;-) Tell me when the filter will be corrected ;-)