Open benjamingeorge opened 9 years ago
In rwp_functions.php you can add the filter methods and it seems to work.
function rwp_img( $id, $settings = null ) {
$element = Picture::create( 'img', $id, $settings );
if ( has_filter( 'rwp_edit_generated_element' ) ) {
$element = apply_filters( 'rwp_edit_generated_element', $element );
}
return $element;
}
Hi! Sorry for the late reply, I've turned off notification mails accidentally ;)
No, you're right. The filter is not applied when calling rwp_img()
or rwp_picture()
. You might be able to use rwp_attributes()
instead, but the filter should of course be applied here to.
Thanks for telling me about this :)
I tried adding your example filter for lazy loading. In my templates I use rwp_img() to get the picturefill markup but the [data-src] attribute isn't added. Is the rwp_edit_generated_element filter called when using rwp_img() or rwp_picture?