Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #51780, comment 22


Ignore:
Timestamp:
02/24/2023 12:22:59 AM (19 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51780, comment 22

    v1 v2  
    1 Not sure this is a good addition to `get_attached_file()`. This function should **get the attached file**, i.e. a PDF, a video, an image, etc. What is the point to extend it only for images? That seems confusing :(
     1Not sure this is a good addition to `get_attached_file()`. This function should **get the attached file**, i.e. a PDF, a video, a document, etc. This function is not intended only for images, what is the point to extend it only for image sub-sizes? That seems confusing and contrary to the initial design decision :(
    22
    33Also, looking at the description, there is no reason why this is needed. If there is really a good reason for such function, it should probably be a new function.
    44
    5 However I don't see a reason why plugin authors cannot use `image_get_intermediate_size()` for this. That's probably currently used anyways.
     5However I don't see a reason why plugin authors cannot use `image_get_intermediate_size()` for this. That is probably currently being used. Getting the path to an image sub-size seems like something that's rarely needed anyway.
    66
    77Another serious objection here is that this patch slows down `get_attached_file()` as it always does another DB request looking for image meta, no matter what file is attached.