Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Allow admin to customize the supported image formats for the image upload button #1516

Open
hexie2108 opened this issue Mar 8, 2025 · 1 comment

Comments

@hexie2108
Copy link

Description:
The currently allowed image formats: 'jpg,jpeg,gif,png,bmp' are hardcoded when creating a new WPUF_Uploader. This causes users to be unable to upload other image formats, even though they are supported in the WordPress backend.
Is it possible to add a custom option that allows to add additional image formats?

Currently released code:

<script type="text/javascript">
           ;(function($) {
                $(document).ready( function(){
                    var uploader = new WPUF_Uploader('wpuf--pickfiles', 'wpuf--upload-container', , '', 'jpg,jpeg,gif,png,bmp', );
                    wpuf_plupload_items.push(uploader);
                });
            })(jQuery);
 </script>
@sapayth
Copy link
Member

sapayth commented Mar 10, 2025

Hello @hexie2108,
Thank you very much for pointing that out. This could be a valuable improvement. We'll surely explore how to implement it.

In the meantime, you can add/modify the extensions in line no: 81 from the file
wp-user-frontend/includes/Fields/Form_Field_Image.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants