Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamsilverstein/wp-fetchpriority-control
wp-image-fetchpriority-control
https://github.com/adamsilverstein/wp-fetchpriority-control
Last synced: about 1 month ago
JSON representation
wp-image-fetchpriority-control
- Host: GitHub
- URL: https://github.com/adamsilverstein/wp-fetchpriority-control
- Owner: adamsilverstein
- Created: 2023-10-09T16:20:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-10T16:15:12.000Z (about 1 year ago)
- Last Synced: 2024-10-15T23:47:25.264Z (2 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fetchpriority Control
## Description
Extends the core image block with a fetchpriority setting.Since WordPress 6.4, core adds the `fetchpriority="high"` attribute to the image it estimates will be the LCP image. This plugin allows you to override that setting with a UI control (a dropdown).
By setting the fetchpriority to a specific image you want to prioritize, WordPress core will honor your selection and skip applying the attribute automatically.
Similarly , if you have an image you want to make sure isn't prioritized, you can set the fetchpriority to "low" and WordPress core will not change that priority.
The new Fetchpriority selector under Advanced when an image block is selected:
![image](https://github.com/adamsilverstein/wp-fetchpriority-control/assets/2676022/f33d5f5f-875c-4310-9098-2ffdfc3772e0)
Fetchpriority options:
![Monosnap Monosnap 2023-10-09 11-16-09](https://github.com/adamsilverstein/wp-fetchpriority-control/assets/2676022/8c97186d-7355-44fa-9ae9-c64fde9a6c9c)
## Building
Install `babel` globally:
`npm install -g @babel/core @babel/cli @babel/preset-env`Build JavaScript:
`babel --presets @babel/preset-react wp-fetchpriority-control.js > wp-fetchpriority-control_babel.js`@TODO: Add a build command
## Credits
Thanks to Sabrina Zeidan who created this control for disabling lazy loading (https://github.com/sabrina-zeidan/sz-disable-lazyload/) which was the starting point / inspiration for this plugin.