Customiying Layzloading of WordPress images

I’m using the image element within Cornerstone (Pro Theme), and my goal is to disable the WordPress-specific lazyloading feature for two single images that are displayed within the Above the Fold area.
As of now, it is not possible to do that in an adequate way as the attributes only support the wrapper:

I’ve tried to make it work by hooking into the core functions of the pro theme, but the function responsible for that is cs_apply_image_atts doesn’t have a filter.
You’ll find it in /pro/cornerstone/includes/functions/helpers.php:223

To allow that at least from a technical perspective, please add a filter to your two return lines inside of the cs_apply_image_atts() function so we can customize it programmatically.

Please turn:
return cs_apply_lazy_loading( cs_apply_alt_text( $atts, $alt, $fallback_alt ), $lazy );

into

return apply_filters( 'cs_apply_image_atts', cs_apply_lazy_loading( cs_apply_alt_text( $atts, $alt, $fallback_alt ), $lazy )  );

Hi @TheOwnplay,

Thank you for the detailed writeup. This is something we can add to our list of feature requests. This way it can be taken into consideration for future development. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive.

Thanks!

Thanks @nabeel.
Will it get prioritized by the amount of interest of the team or the community?
It’s a low-level adjustment meant to enhance the plugin functionality. Community-wise, there will certainly not be many people looking for this as it’s out of the scope of 95% of your users.
Those adjustments help developers who work with your plugin on a regular basis to allow customizations beyond the regular limitations.

1 Like

Hello @TheOwnplay,

We have already added this to our features request list as my colleagues mentioned in the above post. I would request you, please stay tuned for succeeding theme updates.

Thanks for understanding

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.