wordpress-develop/tests
Felix Arntz 5db31259ec Media: Introduce wp_get_attachment_image_context filter.
Since WordPress 5.9, a "context" value of "wp_get_attachment_image" has been used in the `wp_get_attachment_image()` function to provide context to underlying functions where that is relevant, e.g. `wp_get_loading_attr_default()`. Since that value used to be not customizable, it required a workaround in `get_the_post_thumbnail()` to avoid calling those functions in `wp_get_attachment_image()`, which resulted in unnecessary complexity and was prone to errors.

This changeset introduces a `wp_get_attachment_image_context` filter and leverages it with private filter callback functions that are leveraged by default when `get_the_post_thumbnail()` is called. This avoids the need for the previous workaround and furthermore provides flexibility for other callers of `wp_get_attachment_image()` to provide their own contexts.

Props flixos90, costdev, thekt12, westonruter, spacedmonkey.
Fixes #58212.


git-svn-id: https://develop.svn.wordpress.org/trunk@55821 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-17 18:29:41 +00:00
..
e2e Update the WP packages with fixes prior to WP 6.2 beta 3 2023-02-21 13:06:33 +00:00
gutenberg Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests. 2021-06-01 09:21:36 +00:00
performance Build/Test Tools: Add a performance measurement workflow. 2023-03-03 20:37:10 +00:00
phpunit Media: Introduce wp_get_attachment_image_context filter. 2023-05-17 18:29:41 +00:00
qunit REST API: Support non-Latin characters in template route regex. 2023-02-07 23:45:18 +00:00
visual-regression Build/Test Tools: Update some NPM dependencies to the latest versions. 2022-04-08 20:05:03 +00:00