Changing default img html markup but not in admin back-end?

is_admin() is a call that does not verify if the current user role, but rather it was made to check if the code is trying to display in the backend/admin/dashboard area. https://codex.wordpress.org/Function_Reference/is_admin You can try one of three solutions: Reverse the check if(is_admin()) // if display on the dashboard, abort return; ….. your code Check … Read more

How to change image atributes right before an image to be saved?

If the import function you’re using uses wp_insert_post() (used also by wp_insert_attachment()) to add the new images (attachment posts) to your site, then you could perhaps use the wp_insert_attachment_data( array $data, array $postarr ) filter, which is defined inside wp_insert_post(). According to the docs it, Filters attachment post data before it is updated in or … Read more