Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions includes/plugins/class-perfmatters.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,22 @@ private static function get_defaults( $options = [] ) {
$options['lazyload']['youtube_preview_thumbnails'] = true;
$options['lazyload']['image_dimensions'] = true;

$parent_exclusions = empty( $options['lazyload']['lazy_loading_parent_exclusions'] ) ? [] : $options['lazyload']['lazy_loading_parent_exclusions'];
// Add our customizations to the front of the array to avoid confusion when editing the setting in the UI.
$options['lazyload']['lazy_loading_parent_exclusions'] = array_merge(
[ 'wp-block-jetpack-image-compare' ],
$parent_exclusions
$lazy_loading_exclusions = empty( $options['lazyload']['lazy_loading_exclusions'] ) ? [] : $options['lazyload']['lazy_loading_exclusions'];
$options['lazyload']['lazy_loading_exclusions'] = array_unique(
array_merge(
[
'attachment-woocommerce_thumbnail', // If WC product images are within a pagination, the pages loaded after pageload will not not have images handled otherwise.
],
$lazy_loading_exclusions
)
);
$parent_exclusions = empty( $options['lazyload']['lazy_loading_parent_exclusions'] ) ? [] : $options['lazyload']['lazy_loading_parent_exclusions'];
$options['lazyload']['lazy_loading_parent_exclusions'] = array_unique(
array_merge(
[ 'wp-block-jetpack-image-compare' ],
$parent_exclusions
)
);

// Fonts.
Expand Down