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
// Feeds array with title and time | |
$feeds = array( | |
array( | |
'title' => 'Some Feeds.', | |
'time' => '2015-03-31 13:06:00' | |
), | |
array( | |
'title' => 'And another.', | |
'time' => '2015-03-23 13:06:00' | |
), |
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 a file from a URL to the media library, designed to be placed in your own theme or plugin. | |
* Metadata will be generated and images will generate thumbnails automatically. | |
* | |
* HOW TO USE: | |
* 1. Add the function below to your theme or plugin | |
* 2. Call the function and provide the URL to an image or other file. | |
* 3. If successful, the attachment ID will be returned. |