1 | | @mukesh27 Currently, the logic in `wp_get_loading_optimization_attributes()` is heavily tied to specific context values. For example, if you want to display a custom image in the header to be enforced without `loading="lazy"`, you would need to pass the `get_header_image_tag` context, even if the image is not in fact the header image, so that is confusing and inflexible. |
| 1 | @mukesh27 Currently, the logic in `wp_get_loading_optimization_attributes()` is heavily tied to specific context values. For example, if you want to display a custom image in the header to be enforced without `loading="lazy"`, you would need to pass the `get_header_image_tag` context, even if the image is not in fact the header image. Or, if I display an image within the main query loop, it only works correctly if I use one of the predefined contexts like `the_post_thumbnail`, even if I'm not displaying a featured image. So the limitation of specific contexts is confusing and inflexible, and mostly, unnecessary. |