WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #30180, comment 42


Ignore:
Timestamp:
02/21/2019 03:40:46 PM (5 months ago)
Author:
ryanshoover
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30180, comment 42

    initial v1  
    11@afercia We made the call to go with a new function for getting the alt text because of limitations in `wp_get_attachment_image_src`. As @joemcgill points out, the function's name doesn't lend itself to getting extra information about an image other than its `src` attribute. Additionally, it returns results in an indexed array where the developer has to know which "magic number" index attribute refers to which property.
    22
    3 In terms of expanding the current function vs adding a new one - any developer looking get the alt attribute from this ticket's specs will need to write new code anyway. I don't see it as a big leap to ask them to use a new function, rather than have them look for a 4th entry in `wp_get_attachment_image_src`.
     3In terms of expanding the current function vs adding a new one - any developer looking get the alt attribute from this ticket's specs will need to write new code anyway. I don't see it as a big leap to ask them to use a new function, rather than have them look for a 5th entry in `wp_get_attachment_image_src`.
    44
    5 Is there a chance that expanding the return value of `wp_get_attachment_image_src` may break poorly written code? If someone is simply looping through the results to generate their image tag, we may inadvertantly break their tag generation with a 4th option.
     5Is there a chance that expanding the return value of `wp_get_attachment_image_src` may break poorly written code? If someone is simply looping through the results to generate their image tag, we may inadvertantly break their tag generation with a 5th option.