• Hi πŸ™‚

    The following situation: I’m using microformats2 for my blog. In case you’re not familar with microformats, e.g. this can be used to define author h-cards. All microformats markup is done via classes. So for the author avatar I’m just adding ‘u-photo’ to the img tag.
    Other pages can process my data using a microformats parser. Unfortunately they get an empty image for my avatar, because the first ‘u-photo’ has no src-attribute. -The image inside noscript is just the second result, so it will be ignored.

    In ‘class-wp-smush-lazy-load.php:224 I found the following:

    			// Add .lazyload class.
    			$class = $this->get_attribute( $new_image, 'class' );
    			if ( $class ) {
    				$this->remove_attribute( $new_image, 'class' );
    				$class .= ' lazyload';
    			} else {
    				$class = 'lazyload';
    			}
    			$this->add_attribute( $new_image, 'class', $class );
    

    If you would add the ‘apply_filters’ function here, I can remove the class ‘u-photo’ in my functions.php file for the new image. Now the image in the noscript would be the first result and everything would work fine.

    Maybe there are other situations someone would like to add or remove classes from the new image. But even if not, this one line would not hurt anybody.

    So I’d love to hear what you think about my request.

    Regards, Chris

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Request] Lazy Load + Filter for classes’ is closed to new replies.