Skip to content

Instantly share code, notes, and snippets.

function external_images($url_external = null)
{
// Gives us access to the download_url() and wp_handle_sideload() functions
require_once( ABSPATH . 'wp-admin/includes/file.php' );
// URL to the WordPress logo
$url = $url_external;
$timeout_seconds = 5;
// Download file to temp dir