fix: added .ai files to allowed upload mime types #308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The issue here was that WP is not allowing .Ai files to be uploaded by default.
To fix this I used
get_allowed_mime_types()
to get the default types allowed by WP then appended '.ai' files to the list before passing it towp_check_filetype_and_ext()
.The added extensions can also be modified by a filter from now on.
Will affect visual aspect of the product
NO
Screenshots
Test instructions
Try to upload an
.ai
file. I used this sample to test: https://github.com/newsdev/ai2html/blob/master/sample%20files/sample-ai-file.ai .Check before Pull Request is ready:
Closes https://github.com/Codeinwp/ppom-pro/issues/328.