webec
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: wp_get_attachment_image_attributes ignores fetchpriority@bcworkz thanks, I’ll check it and tell you if I can do something with ‘wp_kses_allowed_html’ filter.
@mbigul Astra told me I could add fetchpriority to my features image as I was already doing but not working. WP-Rocket told me to install the Disable Critical Images Optimization plugin (https://docs.wp-rocket.me/article/1816-optimize-critical-images#how-to-deactivate-this-feature) to make ‘wp_get_attachment_image_attributes’ function work, but nothing changed.
I performed additional tests.
Custom attributes such as data-test, data-pepito, and data-fetchpriority are preserved correctly in the final HTML.
The loading=”eager” attribute is also preserved.
However, both fetchpriority=”high” and decoding=”async” are removed from the final HTML when added through wp_get_attachment_image_attributes().
This makes me think that WordPress is not simply filtering unknown attributes, but that fetchpriority and decoding are being specifically recalculated or overridden later by WordPress image optimization functions.Could this be related to wp_get_loading_optimization_attributes() or another image optimization routine introduced in recent WordPress versions?
- This reply was modified 3 weeks, 4 days ago by webec.
Forum: Plugins
In reply to: [AMP] CSS syntax error in tag ‘style amp-custom’I’m having the same issue since 2025.04.22, and I don’t know who is adding it
<style amp-custom="">