• Resolved Rudolph88

    (@rudolph88)


    Hi,

    We are over-writing User avatars by hooking in to get_avatar:
    add_filter( ‘get_avatar’ , ‘site_custom_avatar’ , 10 , 5 );

    This works great on page load for all users as we display a chosen background color and first initial as defined in our “site_custom_avatar” function.

    However, when a user is on the page or post and adds a comment, or a new comment is dynamically loaded in, the avatars that show up are the gravatars (either mystery man as we set in wp settings or their gravatar image). Are you using a different function for these and or is this just a priority issue to over-write those avatars with our custom function as well?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support gVectors Support

    (@gvectorssupport)

    Hi Rudolph88,

    Since wpDiscuz 4.1.2 we’ve added new feature, which allows to store gravatars on local server.
    Please try to disable Gravatar Caching in wpDiscuz Settings, check again and let us know.

    http://www.screencast.com/t/OHkg0dES

    Thread Starter Rudolph88

    (@rudolph88)

    That caching setting was disabled when we were having the issues.

    In our custom function that was over-writing gravatars, we wanted to only over-write the avatars on the front end, so we wrapped our custom code in:
    if ( !is_admin() ) { //Our code here }

    My guess is that because your plugin is using Ajax, dynamically loaded in comments after page load weren’t going through our custom code as is_admin() would be true, skipping over our check and code.

    We removed the if check from our code and it fixed the dynamic loaded in comments and our custom avatars were working. Now our only problem is that in our Dashboard all instances of our avatars for users are also applying our custom code without the if check. This isn’t really a problem for us though.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘get_avatar Not Taking Priority’ is closed to new replies.