You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a navigation overlay and added an image to it. When viewing the page on the frontend, I found that the IMG in the navigation overlay gets fetchpriority=high even though it is not displayed until the nav menu is opened. In contrast, an actual LCP IMG element (e.g. the featured image of the current post) does not get fetchpriority.
Any IMG in the navigation overlay should get a fetchpriority of low to ensure it is deprioritized in favor of the actual IMG which is identified as
The core logic for adding fetchpriority=high is in wp_get_loading_optimization_attributes().
Step-by-step reproduction instructions
Add a navigation overlay to the .
Add an Image block to the navigation overlay which is at least 250x250 in dimensions (so it has wp_min_priority_img_pixels).
Publish a post with a featured image
Load the post on the frontend, and notice the featured image lacks a fetchpriority attribute whereas the IMG in the navigation overlay has fetchpriority=high.
Description
I created a navigation overlay and added an image to it. When viewing the page on the frontend, I found that the
IMGin the navigation overlay getsfetchpriority=higheven though it is not displayed until the nav menu is opened. In contrast, an actual LCPIMGelement (e.g. the featured image of the current post) does not getfetchpriority.Any
IMGin the navigation overlay should get afetchpriorityoflowto ensure it is deprioritized in favor of the actualIMGwhich is identified asThe core logic for adding
fetchpriority=highis inwp_get_loading_optimization_attributes().Step-by-step reproduction instructions
wp_min_priority_img_pixels).fetchpriorityattribute whereas theIMGin the navigation overlay hasfetchpriority=high.Screenshots, screen recording, code snippet
Editor
Frontend with Navigation Collapsed and Expanded
Wrong Image Resource Loaded with High Priority
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.