Skip to content

Instantly share code, notes, and snippets.

View Maurisss94's full-sized avatar
🎯
Focusing

Mauro Balestra Maurisss94

🎯
Focusing
View GitHub Profile
@kellenmace
kellenmace / class-download-remote-image.php
Last active October 13, 2022 13:24
Download and Insert a Remote Image File into the WordPress Media Library
<?php
/**
* This class handles downloading a remote image file and inserting it
* into the WP Media Library.
*
* Usage:
* $download_remote_image = new KM_Download_Remote_Image( $url );
* $attachment_id = $download_remote_image->download();
*