Allow user with capabilities to view downloadable image closes #29988 #30385
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.
All Submissions:
Changes proposed in this Pull Request:
Closes #29988
This one is a bit peculiar because the two functions (https://github.com/woocommerce/woocommerce/blob/trunk/includes/wc-product-functions.php#L488-L526) that runs through the hook doesn't describe what the intention of it was. But from seeing what it is doing in code, I am assuming the intention was to remove images from being shown if they reside in the
woocommerce_uploadsfolder because the assumption is that it is a downloadable file. So the PR here is basically to check if the user actually has the capabilities (manage_woocommerce) and show it for them as they're administering the site.How to test the changes in this Pull Request:
wp-admin/upload.php.Other information:
Changelog entry