You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey!! I think that custom elements should replace native images elements on content output, not on content input. Actually, the content is modified and saved to database. In this way you get stuck to PWP lazy image plugin. If you want to use other lazy load solution or want to change the theme at any point in the future, you will need to rewrite all the posts content and save them again to database.
Alternative: use the_conent filter instead of content_save_pre. This way you preserve the content in the native format and you are free to switch between themes, lazy load solutions or even publishing platforms at any time:
Ok, I will try to fill a pull request. Thank you!!
CybMeta
changed the title
PWP Lazy Image plugin: Add custom elements to content on output, not on save
PWP Lazy Image plugin: Filter content on output, not on input
Jan 30, 2018
Hey!! I think that custom elements should replace native images elements on content output, not on content input. Actually, the content is modified and saved to database. In this way you get stuck to PWP lazy image plugin. If you want to use other lazy load solution or want to change the theme at any point in the future, you will need to rewrite all the posts content and save them again to database.
Alternative: use
the_conent
filter instead ofcontent_save_pre
. This way you preserve the content in the native format and you are free to switch between themes, lazy load solutions or even publishing platforms at any time:add_filter('the_content' , 'lazify_images', 0, 1);
It can add a very little extra work in every request, but you get more freedom. What do you think?
The text was updated successfully, but these errors were encountered: