This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function uploads from a URL. | |
* To upload from a local file path instead | |
* @see: https://gist.github.com/RadGH/3b544c827193927d1772 | |
* | |
* Example usage: Upload photo from URL, display the attachment as as html <img> | |
* $attachment_id = rs_upload_from_url( "http://example.com/images/photo.png" ); | |
* echo wp_get_attachment_image( $attachment_id, 'large' ); |
OlderNewer