imgタグにloading属性が付与される挙動について
-
WordPressのテーマにて、
get_header()
の有無でthe_content()
より出力されるimgタグにloading="lazy"
が付与されたり・されなかったりする挙動が見られるようですが、これは仕様でしょうか?Ver 6.3.5までは
get_header()
の有無で挙動は変わらないようですが、Ver 6.4系以降get_header()
があるとloading属性は付与されないようでした。以下は挙動の確認をまとめた表です。
確認に用いたコードは以下リポジトリよりご参照頂けます。
https://github.com/TsubasaHiga/wp-lazy-test-theme以下は確認環境です。
Ver 6.3.5get_header()
あり(loading属性あり)
https://sweet-router.localsite.io/hello-world
amusement / lovingget_header()
なし(loading属性あり)
https://innate-sunrise.localsite.io/hello-world
recipe / flashyVer 6.4.0(以降すべて同様の挙動のようです)
get_header()
あり(loading属性なし)
https://cuddly-spiral.localsite.io/hello-world
parachute / generalget_header()
なし(loading属性あり)
https://panicky-mine.localsite.io/hello-world
jewelry / noiseless仕様でしたらこの辺りのドキュメントを探しておりますので、ご存知の方がいらっしゃいましたら教えていただけますと幸いです。
- このトピックに返信するにはログインが必要です。