Automática de importación de imágenes en mensajes de direcciones URL en la Web?
Pregunta
¿Hay alguna manera de añadir una etiqueta <img>
en un post, pero luego tienen una descarga plugin de esa imagen, y lo puso en el servidor para mí en lugar de mi necesidad de descargar manualmente el archivo de en línea a mi ordenador y luego subirlo al servidor?
Gracias
Solución
Sure. You could hook the save_post
action, use WP_Http
class to download it and then insert it as an attachment using wp_insert_attachment
and wp_update_attachment_metadata()
.
It's not trivial but shouldn't be that hard.
Otros consejos
There is a plugin called "Add Linked Images To Gallery" - when you insert an image to your post from an external website, this plugin automatically save a local copy and replace the link to the external site with the local address. hope it helps.
There is a newer plugin in the Wordpress repository which works. Add Linked images to Gallery does not work anymore. Import External Images