For example, we have some image on the external site: http://site.com/image.png
How do I upload this image to my wordpress as an image attachment by php?
Image should be copied to my uploads folder, post added, meta generated.
|
For example, we have some image on the external site: http://site.com/image.png How do I upload this image to my wordpress as an image attachment by php? Image should be copied to my uploads folder, post added, meta generated. |
|||
|
|
|
You can
or you can use a plugin like Cache Images which uploads all external images to your server as attachments. |
|||
|
|