Changeset 3089815
- Timestamp:
- 05/21/2024 04:16:07 AM (21 months ago)
- Location:
- lazy-embed/trunk
- Files:
-
- 2 edited
-
lazy-embed.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lazy-embed/trunk/lazy-embed.php
r3089755 r3089815 7 7 * Plugin URI: https://bitbucket.org/beleaf-au/lazy-embed/ 8 8 * Description: Improves the performance and reduces the emissions of your website by only loading embeds (youtube, vimeo, etc) when they are clicked. 9 * Version: 1.6. 19 * Version: 1.6.2 10 10 * Requires PHP: 7.1 11 11 * Requires at least: 6.2.0 … … 34 34 { 35 35 if ($block['blockName'] === 'core/embed' || $block['blockName'] === 'core/video') { 36 $tag = $block['blockName'] === 'core/embed'37 ? 'iframe'38 : 'video';39 40 $processor = new \WP_HTML_Tag_Processor($html);41 $processor->next_tag($tag);42 43 36 if (!empty($block['attrs']['className']) && str_contains($block['attrs']['className'], self::IGNORE_STRING)) { 37 $tag = $block['blockName'] === 'core/embed' 38 ? 'iframe' 39 : 'video'; 40 41 $processor = new \WP_HTML_Tag_Processor($html); 42 $processor->next_tag($tag); 44 43 $processor->add_class(self::IGNORE_STRING); 45 return $processor->get_updated_html();46 }elseif($tag === 'iframe') {47 $processor->set_attribute('loading', 'lazy');48 44 return $processor->get_updated_html(); 49 45 } … … 129 125 $processor->set_attribute('srcdoc', $srcdoc); 130 126 127 // Add lazy loading 128 $processor->set_attribute('loading', 'lazy'); 129 131 130 return $processor; 132 131 } -
lazy-embed/trunk/readme.txt
r3089755 r3089815 4 4 Requires at least: 6.2.0 5 5 Tested up to: 6.4 6 Stable tag: 1.6. 16 Stable tag: 1.6.2 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 27 27 == Changelog == 28 28 29 = 1.6.1 = 29 = 1.6.2 - 21/05/2024 = 30 Fix iframe lazy loading implementation 31 32 = 1.6.1 - 21/05/2024 = 30 33 Fix: Load high resolution thumbnail from youtube 31 34 Fix: Lazy load iframe and img tag placeholder
Note: See TracChangeset
for help on using the changeset viewer.