From the creators of Nextend Social Login: Meet Mosaic, our new visual theme builder for WordPress.
Join Beta

How to prevent GIF avatars from being downloaded?

GIF files can be relatively large, which may increase bandwidth usage. If you want to prevent GIFs from being downloaded or used as avatars, you can disable them as shown below

Code
add_action('nsl_update_avatar', function ($provider, $user_id, $avatarUrl) {
    $path = parse_url($avatarUrl, PHP_URL_PATH);

    if ($path && strtolower(pathinfo($path, PATHINFO_EXTENSION)) === 'gif') {
        remove_action('nsl_update_avatar', array(
            NextendSocialLoginAvatar::getInstance(),
            'updateAvatar'
        ), 10);
    }
}, 1, 3);
🍪 We use cookies!

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. You can manage your preferences or learn more in our Cookie Policy.

Accept all
Reject all
Cookie Policy