PluginProbe
Disable Lazy Load / trunk
Disable Lazy Load vtrunk
2.7 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.6.1 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6
disable-lazy-loading / disable-lazy-loading.php

disable-lazy-loading.php in Disable Lazy Load trunk, at disable-lazy-loading.php

46 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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: 7.1
13 Stable tag: 2.7
14 Version: 2.7
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 2020-2026 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');