| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Disable Lazy Load |
| 4 |
Plugin URI: https://perishablepress.com/wordpress-disable-lazy-loading/ |
| 5 |
Description: Activate this plugin to disable WP Lazy Loading. |
| 6 |
Tags: lazy load, lazyload, images, lazy, load |
| 7 |
Author: Jeff Starr |
| 8 |
Author URI: https://plugin-planet.com/ |
| 9 |
Donate link: https://monzillamedia.com/donate.html |
| 10 |
Contributors: specialk |
| 11 |
Requires at least: 5.4 |
| 12 |
Tested up to: 6.7 |
| 13 |
Stable tag: 2.2 |
| 14 |
Version: 2.2 |
| 15 |
Requires PHP: 5.6.20 |
| 16 |
Text Domain: disable-lazy-loading |
| 17 |
Domain Path: /languages |
| 18 |
License: GPL v2 or later |
| 19 |
*/ |
| 20 |
|
| 21 |
/* |
| 22 |
This program is free software; you can redistribute it and/or |
| 23 |
modify it under the terms of the GNU General Public License |
| 24 |
as published by the Free Software Foundation; either version |
| 25 |
2 of the License, or (at your option) any later version. |
| 26 |
|
| 27 |
This program is distributed in the hope that it will be useful, |
| 28 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 29 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 30 |
GNU General Public License for more details. |
| 31 |
|
| 32 |
You should have received a copy of the GNU General Public License |
| 33 |
with this program. If not, visit: https://www.gnu.org/licenses/ |
| 34 |
|
| 35 |
Copyright 2024 Monzilla Media. All rights reserved. |
| 36 |
*/ |
| 37 |
|
| 38 |
if (!defined('ABSPATH')) die(); |
| 39 |
|
| 40 |
add_filter('wp_lazy_loading_enabled', '__return_false'); |
| 41 |
|
| 42 |
function disable_lazy_load_featured_images($attr, $attachment = null) { |
| 43 |
$attr['loading'] = 'eager'; |
| 44 |
return $attr; |
| 45 |
} |
| 46 |
add_filter('wp_get_attachment_image_attributes', 'disable_lazy_load_featured_images'); |