-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove check for wp_get_image_mime()
I tried to call get_post() as late as possible, for better performance. But then I saw that wp_get_attachment_url() calls get_post() anyways, so it doesn’t really matter. By moving get_post() further to the top, we can use the post_mime_type property of the attachment instead fo the wp_get_image_mime() function. This seems to work better, because it doesn’t have to use the URL of the image, but a local file path. Using the URL could lead to an error with SSL certificates on localhost.
- Loading branch information
Showing
1 changed file
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters