responsify-wp icon indicating copy to clipboard operation
responsify-wp copied to clipboard

<img srcset="" sizes="px"> output

Open IvanPr opened this issue 7 years ago • 3 comments

The rwp_img( $image_id, $rwp_settings); returns "" if the requested $rwp_settings produce no valid scrset of image-sizes [the image-sizes were not re-generated].

I would expect the FALSE result instead.

IvanPr avatar Oct 31 '17 09:10 IvanPr

Hi! Does this happen when rwp_img() is unable to create an <img> element?

stefanledin avatar Oct 31 '17 09:10 stefanledin

Yes, exactly. For example, when several image-sizes are specified in $rwp_settings but the image-sizes itself does not exist... say, were not re-generated after changing an image size...

IvanPr avatar Oct 31 '17 19:10 IvanPr

I haven't tried this, but what if you try something like this:

<?php
add_filter( 'rwp_edit_generated_element', function( $element ) {
    if ( $element == '' ) return false;
    return $element;
} );
?>

stefanledin avatar Nov 01 '17 07:11 stefanledin