From the creators of Nextend Social Login: Meet Mosaic, a visual workflow built on real web fundamentals for WordPress.
Try now

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);
Your cookie preferences

We use cookies to improve your experience, analyze traffic, and personalize content. By clicking "Accept all" you agree to storing them on your device. Read our privacy policy.