How to allow gif avatars?
-
Hello there. I’ve notice that we can upload gif animated avatars, and while we “crop’ them, they are moving. But once we save, they are static. When i check the uploaded gif, it’s not animated. How can we forbid ultimate member not to touch uploaded gifs and let them animated? I’ve tried using chatgtp to tell me fix and i’ve got that:
add_action('wp_footer', 'load_conditional_script'); function disable_gif_processing($sizes, $metadata) { // Проверка за MIME типа на файла if ($metadata['mime-type'] === 'image/gif') { // Не обработвайте GIF файловете return []; } // За всички други типове изображения, прилагайте стандартните размери return $sizes; } add_filter('intermediate_image_sizes_advanced', 'disable_gif_processing', 10, 2); function preserve_gif_upload($file) { // Проверка дали файлът е GIF if ($file['type'] === 'image/gif') { // Връща файлът без изменения return $file; } // Прилагай стандартната логика за всички други типове файлове return $file; } add_filter('wp_handle_upload_prefilter', 'preserve_gif_upload');
But it’s not working. Can you tell me any fix on how ultimate member manage gif files , maybe option or custom code to allow animated gifs?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to allow gif avatars?’ is closed to new replies.