LazyLoad Plugin 2.4.1 has 0 actions and 16 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Change a value LazyLoad Plugin is about to use
add_filter( 'rocket_lazyload_placeholder', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
rocket_lazyload_placeholder
filter/** * Filter the LazyLoad placeholder on src attribute */ apply_filters( 'rocket_lazyload_placeholder', 'about:blank' ); -
do_rocket_lazyload
filter/** * Filters the lazyload application */ apply_filters( 'do_rocket_lazyload', true ); -
/** * Regex to detect bg images inside CSS. */ apply_filters( 'rocket_lazyload_bg_images_regex', 'background-image\s*:\s*(?<attr>\s*url\s*\((?<url>[^)]+)\))\s*;?' ); -
/** * Filters the patterns excluded from lazyload for youtube thumbnails. */ apply_filters( 'rocket_lazyload_exclude_youtube_thumbnail', [] ); -
/** * Filters the attributes used to prevent lazylad from being applied */ apply_filters( 'rocket_lazyload_excluded_attributes', [ 'data-src=', 'data-no-lazy=', 'data-lazy-original=', 'data-lazy-src=', 'data-lazysrc=', 'data-lazyload=', 'data-bgposition=', 'data-envira-src=', 'fullurl=', 'lazy-slider-img=', 'data-srcset=', 'class="ls-l', 'class="ls-bg', 'soliloquy-image', 'loading="eager"', 'swatch-img', 'data-height-percentage', 'data-large_image', 'avia-bg-style-fixed', 'data-skip-lazy', 'skip-lazy', 'image-compare__', ] ); -
rocket_lazyload_excluded_src
filter/** * Filters the src used to prevent lazylad from being applied */ apply_filters( 'rocket_lazyload_excluded_src', [ '/wpcf7_captcha/', 'timthumb.php?src', 'woocommerce/assets/images/placeholder.png', ] ); -
rocket_lazyload_html
filter/** * Filter the LazyLoad HTML output */ apply_filters( 'rocket_lazyload_html', $image_lazyload ); -
/** * Filters the patterns excluded from lazyload for iframes */ apply_filters( 'rocket_lazyload_iframe_excluded_patterns', [ 'gform_ajax_frame', 'data-no-lazy=', 'recaptcha/api/fallback', 'loading="eager"', 'data-skip-lazy', 'skip-lazy', 'google_ads_iframe_', ] ); -
rocket_lazyload_iframe_html
filter/** * Filter the LazyLoad HTML output on iframes */ apply_filters( 'rocket_lazyload_iframe_html', $iframe_lazyload ); -
rocket_lazyload_script_args
filter/** * Filters the arguments array for the lazyload script options */ apply_filters( 'rocket_lazyload_script_args', $inline_args ); -
rocket_lazyload_script_tag
filter/** * Filters the script tag for the lazyload script */ apply_filters( 'rocket_lazyload_script_tag', '<script data-no-minify="1" async src="' . $args['base_url'] . $args['version'] . '/lazyload' . $min . '.js"></script>' ); -
rocket_lazyload_threshold
filter/** * Filters the threshold at which lazyload is triggered */ apply_filters( 'rocket_lazyload_threshold', 300 ); -
rocket_lazyload_youtube_html
filter/** * Filter the LazyLoad HTML output on Youtube iframes */ apply_filters( 'rocket_lazyload_youtube_html', '<div class="rll-youtube-player" data-src="' . esc_attr( $youtube_url ) . '" data-id="' . esc_attr( $youtube_id ) . '" data-query="' . esc_attr( $query ) . '" data-alt="' . esc_attr( $title ) . '"></div>' ); -
/** * Filters the resolution of the YouTube thumbnail */ apply_filters( 'rocket_lazyload_youtube_thumbnail_resolution', 'hqdefault' ); -
rocket_use_native_lazyload
filter/** * Filters the use of native lazyload for images */ apply_filters( 'rocket_use_native_lazyload', false ); -
smilies_src
filter/** * Filter the Smiley image URL before it's used in the image element. */ apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
Generated from LazyLoad Plugin's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: