Changes between Initial Version and Version 1 of Ticket #30180, comment 42
- Timestamp:
- 02/21/2019 03:40:46 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30180, comment 42
initial v1 1 1 @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. 2 2 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`.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 5th entry in `wp_get_attachment_image_src`. 4 4 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.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 5th option.